diff options
author | Keith Packard <keithp@keithp.com> | 2009-12-19 14:03:11 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-12-19 14:14:40 -0800 |
commit | 598d168bd6552c3756e4b0267de44147eadab9f6 (patch) | |
tree | adf8f22af37c29ebeb1610987b7f1466e85de5b0 /src/ao_packet_slave.c | |
parent | d4cf1446680d8b47396bcda338e8df7af395d102 (diff) |
Disable monitor mode before attempting radio test.
If monitor mode is left active, then the radio lock will not be able
to be acquired for the radio test.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_packet_slave.c')
-rw-r--r-- | src/ao_packet_slave.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ao_packet_slave.c b/src/ao_packet_slave.c index ba5ad1c1..122c4da0 100644 --- a/src/ao_packet_slave.c +++ b/src/ao_packet_slave.c @@ -40,13 +40,15 @@ ao_packet_slave_start(void) void ao_packet_slave_stop(void) { - ao_packet_enable = 0; - ao_radio_abort(); - while (ao_packet_task.wchan) { - ao_wake_task(&ao_packet_task); - ao_yield(); + if (ao_packet_enable) { + ao_packet_enable = 0; + ao_radio_abort(); + while (ao_packet_task.wchan) { + ao_wake_task(&ao_packet_task); + ao_yield(); + } + ao_radio_set_telemetry(); } - ao_radio_set_telemetry(); } void |