minor changes

This commit is contained in:
fros4943 2007-04-02 16:31:28 +00:00
parent 4be0e0ea8b
commit 66e6ce1656
3 changed files with 13 additions and 14 deletions

View file

@ -26,10 +26,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: testbutton.c,v 1.2 2007/03/22 10:04:47 fros4943 Exp $
* $Id: testbutton.c,v 1.3 2007/04/02 16:31:28 fros4943 Exp $
*/
#include "contiki.h"
#include "sys/loader.h"
@ -60,10 +59,10 @@ PROCESS_THREAD(button_test_process, ev, data)
while(1) {
PROCESS_WAIT_EVENT();
if (button_sensor.value(0)) {
if (ev == sensors_event && data == &button_sensor && button_sensor.value(0)) {
custom_counter++;
sprintf(logMess, "button> Button pressed (counter=%i)\n", custom_counter);
sprintf(logMess, "Button pressed (counter=%i)\n", custom_counter);
log_message(logMess, "");
}
}

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: testetimer.c,v 1.1 2006/08/21 12:11:17 fros4943 Exp $
* $Id: testetimer.c,v 1.2 2007/04/02 16:31:28 fros4943 Exp $
*/
@ -59,7 +59,7 @@ PROCESS_THREAD(etimer_test_process, ev, data)
etimer_set(&mytimer, 1111);
sprintf(logMess, "Starting ETimer test process (counter=%i)\n", custom_counter);
sprintf(logMess, "Starting event timer test process (counter=%i)\n", custom_counter);
log_message(logMess, "");
while(1) {
@ -67,7 +67,7 @@ PROCESS_THREAD(etimer_test_process, ev, data)
if (etimer_expired(&mytimer)) {
custom_counter++;
sprintf(logMess, "etimer> Timed out(counter=%i)\n", custom_counter);
sprintf(logMess, "Timed out (counter=%i)\n", custom_counter);
log_message(logMess, "");
etimer_restart(&mytimer);

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: testserial.c,v 1.1 2006/08/21 12:11:16 fros4943 Exp $
* $Id: testserial.c,v 1.2 2007/04/02 16:31:28 fros4943 Exp $
*/
@ -58,22 +58,22 @@ PROCESS_THREAD(serial_test_process, ev, data)
etimer_set(&mytimer, CLOCK_SECOND);
/* Starts the serial process among other */
serial_init();
/* Starts the serial process among other */
serial_init();
log_message("serial> Starting test process\n", "");
log_message("Starting serial test process\n", "");
while(1) {
PROCESS_WAIT_EVENT();
if (etimer_expired(&mytimer)) {
log_message("serial> Sending serial data now\n", "");
log_message("Sending serial data now\n", "");
etimer_restart(&mytimer);
rs232_print("GNU's not Unix\n");
rs232_print("GNU's not Unix\n");
}
if(ev == serial_event_message) {
log_message("serial> Message received: ", data);
log_message("Message received: ", data);
}
}