-static void
-ao_send_baro(void)
-{
- uint8_t sample = ao_sample_data;
- uint8_t samples = (sample - ao_baro_sample) & (AO_DATA_RING - 1);
-
- if (samples > 12) {
- ao_baro_sample = (ao_baro_sample + (samples - 12)) & (AO_DATA_RING - 1);
- samples = 12;
- }
- telemetry.generic.tick = ao_data_ring[sample].tick;
- telemetry.generic.type = AO_TELEMETRY_BARO;
- telemetry.baro.samples = samples;
- for (sample = 0; sample < samples; sample++) {
- telemetry.baro.baro[sample] = ao_data_ring[ao_baro_sample].adc.pres;
- ao_baro_sample = ao_data_ring_next(ao_baro_sample);
- }
- ao_radio_send(&telemetry, sizeof (telemetry));
-}