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 ba5ad1c1d13e6f0ca2cb4069454cb5fdf66d721e..122c4da0588148ffb18d9b8daacc5a553cdbcfca 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 1a0cf4fa2dee22546c5ea6c75f916cf6b411a584..bb19c6a99f77934c00f8007d9dcb15375f479c78 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 5250078e7c8df351df22dd9932f26d96587e26f6..990b0d77d0a17988b43cefe71b63499c1ccbabe8 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)
 {