Disable monitor mode before attempting radio test.
authorKeith Packard <keithp@keithp.com>
Sat, 19 Dec 2009 22:03:11 +0000 (14:03 -0800)
committerKeith Packard <keithp@keithp.com>
Sat, 19 Dec 2009 22:14:40 +0000 (14:14 -0800)
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>
src/ao_packet_slave.c
src/ao_radio.c
src/ao_telemetrum.c

index ba5ad1c..122c4da 100644 (file)
@@ -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
index 1a0cf4f..bb19c6a 100644 (file)
@@ -448,6 +448,7 @@ ao_radio_rdf_abort(void)
 void
 ao_radio_test(void)
 {
+       ao_set_monitor(0);
        ao_packet_slave_stop();
        ao_radio_get();
        printf ("Hit a character to stop..."); flush();
index 5250078..990b0d7 100644 (file)
 
 #include "ao.h"
 
+/* stub so as telemetrum doesn't have monitor mode */
+void
+ao_set_monitor(uint8_t monitoring)
+{
+       (void) monitoring;
+}
+
 void
 main(void)
 {