X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fao_radio.c;h=f4a9d3b265edb1a82ea37ee95cac9568022da9c6;hb=15da683c2f747baef49c8b8d321a86faede0de30;hp=6d25df39e0d98bdb149f365a24f5f993c1dba764;hpb=cd49847f3125df1733f298b56a43e8027ab5ce05;p=fw%2Faltos diff --git a/src/ao_radio.c b/src/ao_radio.c index 6d25df39..f4a9d3b2 100644 --- a/src/ao_radio.c +++ b/src/ao_radio.c @@ -275,7 +275,7 @@ __xdata uint8_t ao_radio_done; __xdata uint8_t ao_radio_mutex; void -ao_radio_general_isr(void) interrupt 16 +ao_radio_general_isr(void) __interrupt 16 { S1CON &= ~0x03; if (RFIF & RFIF_IM_TIMEOUT) { @@ -317,26 +317,25 @@ ao_radio_idle(void) { if (RF_MARCSTATE != RF_MARCSTATE_IDLE) { - RFST = RFST_SIDLE; do { + RFST = RFST_SIDLE; ao_yield(); } while (RF_MARCSTATE != RF_MARCSTATE_IDLE); } } -static void +void ao_radio_get(void) { ao_config_get(); ao_mutex_get(&ao_radio_mutex); ao_radio_idle(); RF_CHANNR = ao_config.radio_channel; - RF_FREQ2 = (uint8_t) (ao_config.radio_frequency >> 16); - RF_FREQ1 = (uint8_t) (ao_config.radio_frequency >> 8); - RF_FREQ0 = (uint8_t) (ao_config.radio_frequency); + RF_FREQ2 = (uint8_t) (ao_config.radio_cal >> 16); + RF_FREQ1 = (uint8_t) (ao_config.radio_cal >> 8); + RF_FREQ0 = (uint8_t) (ao_config.radio_cal); } -#define ao_radio_put() ao_mutex_put(&ao_radio_mutex) void ao_radio_send(__xdata struct ao_telemetry *telemetry) __reentrant @@ -449,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();