Abort any in-progress radio operation when changing radio channel
authorKeith Packard <keithp@keithp.com>
Mon, 21 Jun 2010 22:53:33 +0000 (15:53 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 21 Jun 2010 22:53:33 +0000 (15:53 -0700)
In monitor mode, the current receive operation must be aborted so that
the radio channel change can take effect without receiving a
telemetry packet on the old channel. Aborting any in-progress radio
operation will make sure that happens.

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

index 8df994a643d79e376814a10ed9ebddcdbb99b516..cbd639a5d026461571b9b979ceb79017327fd00a 100644 (file)
@@ -151,6 +151,7 @@ ao_config_radio_channel_set(void) __reentrant
        ao_config_dirty = 1;
        ao_mutex_put(&ao_config_mutex);
        ao_config_radio_channel_show();
+       ao_radio_abort();
 }
 
 #if HAS_ADC