From 2a75a4a5df3f756c1e44eed9621a0c93a6674d99 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Thu, 3 Feb 2011 18:09:51 -0500 Subject: [PATCH] this fixes a major problem with the maca_process Before it didn't do process_poll like it should and would add events out of turn and mess up the event processor --- that would cause the button to stop working after the unhandled events exceeded a max number this fixes maca_process to do a process_poll as it should. now the button works fine and so does the radio. --- cpu/mc1322x/contiki-maca.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cpu/mc1322x/contiki-maca.c b/cpu/mc1322x/contiki-maca.c index 8a2a12ee2..5b56ac22b 100644 --- a/cpu/mc1322x/contiki-maca.c +++ b/cpu/mc1322x/contiki-maca.c @@ -247,7 +247,7 @@ PROCESS_THREAD(contiki_maca_process, ev, data) PROCESS_BEGIN(); while (1) { - PROCESS_PAUSE(); + PROCESS_YIELD(); /* check if there is a request to turn the radio on or off */ if(contiki_maca_request_on == 1) { @@ -274,6 +274,11 @@ PROCESS_THREAD(contiki_maca_process, ev, data) PROCESS_END(); } +void maca_rx_callback(volatile packet_t *p __attribute((unused))) { + process_poll(&contiki_maca_process); +} + + #if BLOCKING_TX void maca_tx_callback(volatile packet_t *p __attribute((unused))) { tx_complete = 1;