From b3bb3ff53df94ddd786267051b172b354695e89e Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Sun, 2 Dec 2012 14:25:39 -0500 Subject: [PATCH 1/2] fix very incorrect insert_at_rx_head; the bugged version would make the rest of the rx list dangling. this is used to insert the ack packet needed by the upper layers in the netstack. --- cpu/mc1322x/lib/maca.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpu/mc1322x/lib/maca.c b/cpu/mc1322x/lib/maca.c index 475f75700..68b506e87 100644 --- a/cpu/mc1322x/lib/maca.c +++ b/cpu/mc1322x/lib/maca.c @@ -559,7 +559,8 @@ void insert_at_rx_head(volatile packet_t *p) { } else { rx_head->right = p; p->left = rx_head; - rx_head = p; rx_head->left = 0; + p->right = 0; + rx_head = p; } // print_packets("insert at rx head"); From f60a00b93ed1d2849da3847108e3a16a6475802d Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Sun, 2 Dec 2012 14:26:51 -0500 Subject: [PATCH 2/2] the contiki-maca process should wait for a poll event --- cpu/mc1322x/contiki-maca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/mc1322x/contiki-maca.c b/cpu/mc1322x/contiki-maca.c index 17e975087..6fc554819 100644 --- a/cpu/mc1322x/contiki-maca.c +++ b/cpu/mc1322x/contiki-maca.c @@ -295,7 +295,7 @@ PROCESS_THREAD(contiki_maca_process, ev, data) PROCESS_BEGIN(); while (1) { - PROCESS_YIELD(); + PROCESS_YIELD_UNTIL(ev == PROCESS_EVENT_POLL); /* check if there is a request to turn the radio on or off */ if(contiki_maca_request_on == 1) {