altos: Don't abort radio transmissions with ao_radio_abort
authorKeith Packard <keithp@keithp.com>
Wed, 24 Nov 2010 02:57:49 +0000 (18:57 -0800)
committerKeith Packard <keithp@keithp.com>
Wed, 24 Nov 2010 03:10:27 +0000 (19:10 -0800)
We only want to abort pending radio reception to release the radio for
other use, or to change the radio channel. Let radio transmission
proceed. This fixes a problem with using packet mode to configure the
radio channel; if the packet transmission is aborted, the TM ends up
wedged.

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

index 3fb4afd7d4831d87c556a201634655e70ba95b3c..b2105ff89c41e3add1f5a86aade8d650952ed953 100644 (file)
@@ -432,8 +432,11 @@ ao_radio_rdf(int ms)
 void
 ao_radio_abort(void)
 {
 void
 ao_radio_abort(void)
 {
-       ao_dma_abort(ao_radio_dma);
-       ao_radio_idle();
+       /* Only abort if a task is waiting to receive data */
+       if (RFST == RFST_SRX) {
+               ao_dma_abort(ao_radio_dma);
+               ao_radio_idle();
+       }
 }
 
 void
 }
 
 void