DMA_CFG1_PRIORITY_HIGH);
ao_dma_start(ao_radio_dma);
RFST = RFST_STX;
- while (!ao_radio_dma_done)
+ __critical while (!ao_radio_dma_done)
ao_sleep(&ao_radio_dma_done);
ao_mutex_put(&ao_radio_mutex);
}
DMA_CFG1_PRIORITY_HIGH);
ao_dma_start(ao_radio_dma);
RFST = RFST_SRX;
- while (!ao_radio_dma_done)
+ __critical while (!ao_radio_dma_done)
ao_sleep(&ao_radio_dma_done);
ao_mutex_put(&ao_radio_mutex);
}
uint8_t ao_serial_number = 2;
-void
-ao_telemetry_send(__xdata struct ao_telemetry *telemetry) __reentrant
-{
- if (ao_flight_state != ao_flight_idle && ao_flight_state != ao_flight_startup) {
- telemetry->addr = ao_serial_number;
- telemetry->flight_state = ao_flight_state;
- ao_radio_send(telemetry);
- }
-}
-
void
ao_telemetry(void)
{
ao_sleep(DATA_TO_XDATA(&ao_flight_state));
for (;;) {
+ telemetry.addr = ao_serial_number;
+ telemetry.flight_state = ao_flight_state;
ao_adc_get(&telemetry.adc);
ao_mutex_get(&ao_gps_mutex);
memcpy(&telemetry.gps, &ao_gps_data, sizeof (struct ao_gps_data));
ao_mutex_put(&ao_gps_mutex);
- ao_telemetry_send(&telemetry);
+ ao_radio_send(&telemetry);
ao_delay(AO_MS_TO_TICKS(1000));
}
}