altos: Abort radio harder when terminating packet mode.
authorKeith Packard <keithp@keithp.com>
Mon, 30 Aug 2010 05:42:23 +0000 (22:42 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 30 Aug 2010 05:42:23 +0000 (22:42 -0700)
Make sure the master radio tasks don't get stuck waiting for an
incoming packet again by aborting the radio each time we poke the
tasks.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/ao_packet_master.c

index 5e13a91adecb3889727688e172e0f9a957458fb3..50f5aeffc79101725df181261fe3408c801f6a4e 100644 (file)
@@ -126,8 +126,8 @@ ao_packet_forward(void) __reentrant
        for (c = 0; (ao_packet_tx_used || ao_tx_packet.len) && c < 10; c++)
                ao_delay(AO_MS_TO_TICKS(100));
        ao_packet_enable = 0;
        for (c = 0; (ao_packet_tx_used || ao_tx_packet.len) && c < 10; c++)
                ao_delay(AO_MS_TO_TICKS(100));
        ao_packet_enable = 0;
-       ao_radio_abort();
        while (ao_packet_echo_task.wchan || ao_packet_task.wchan) {
        while (ao_packet_echo_task.wchan || ao_packet_task.wchan) {
+               ao_radio_abort();
                ao_wake_task(&ao_packet_echo_task);
                ao_wake_task(&ao_packet_task);
                ao_yield();
                ao_wake_task(&ao_packet_echo_task);
                ao_wake_task(&ao_packet_task);
                ao_yield();