summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-11-23 18:57:49 -0800
committerKeith Packard <keithp@keithp.com>2010-11-23 19:10:27 -0800
commit54468e5dc567aaac5c5c20e921859b7cec28bb88 (patch)
treef65544d48536f67e291877f9f644fa07464486c3
parentd873dc28f0752aeb58a6263e42bdd5b9095bd392 (diff)
altos: Don't abort radio transmissions with ao_radio_abort
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>
-rw-r--r--src/ao_radio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ao_radio.c b/src/ao_radio.c
index 3fb4afd7..b2105ff8 100644
--- a/src/ao_radio.c
+++ b/src/ao_radio.c
@@ -432,8 +432,11 @@ ao_radio_rdf(int ms)
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