static __xdata union ao_telemetry_all telemetry;
+static void
+ao_telemetry_send(void)
+{
+ ao_radio_send(&telemetry, sizeof (telemetry));
+ ao_delay(1);
+}
+
#if defined AO_TELEMETRY_SENSOR
/* Send sensor packet */
static void
telemetry.sensor.accel_minus_g = 0;
#endif
- ao_radio_send(&telemetry, sizeof (telemetry));
+ ao_telemetry_send();
}
#endif
telemetry.mega_sensor.mag_z = packet->hmc5883.z;
#endif
- ao_radio_send(&telemetry, sizeof (telemetry));
+ ao_telemetry_send();
}
static __pdata int8_t ao_telemetry_mega_data_max;
telemetry.mega_data.speed = ao_speed;
telemetry.mega_data.height = ao_height;
- ao_radio_send(&telemetry, sizeof (telemetry));
ao_telemetry_mega_data_cur = ao_telemetry_mega_data_max;
+ ao_telemetry_send();
}
}
#endif /* AO_SEND_MEGA */
telemetry.metrum_sensor.sense_a = packet->adc.sense_a;
telemetry.metrum_sensor.sense_m = packet->adc.sense_m;
- ao_radio_send(&telemetry, sizeof (telemetry));
+ ao_telemetry_send();
}
static __pdata int8_t ao_telemetry_metrum_data_max;
telemetry.metrum_data.accel_minus_g = 2;
#endif
- ao_radio_send(&telemetry, sizeof (telemetry));
ao_telemetry_metrum_data_cur = ao_telemetry_metrum_data_max;
+ ao_telemetry_send();
}
}
#endif /* AO_SEND_METRUM */
telemetry.mini.ground_pres = ao_ground_pres;
- ao_radio_send(&telemetry, sizeof (telemetry));
+ ao_telemetry_send();
}
#endif /* AO_SEND_MINI */
ao_xmemcpy (telemetry.configuration.version,
CODE_TO_XDATA(ao_version),
AO_MAX_VERSION);
- ao_radio_send(&telemetry, sizeof (telemetry));
ao_telemetry_config_cur = ao_telemetry_config_max;
+ ao_telemetry_send();
}
}
27);
telemetry.location.tick = ao_gps_tick;
ao_mutex_put(&ao_gps_mutex);
- ao_radio_send(&telemetry, sizeof (telemetry));
ao_telemetry_loc_cur = ao_telemetry_gps_max;
+ ao_telemetry_send();
}
}
&ao_gps_tracking_data.sats,
AO_MAX_GPS_TRACKING * sizeof (struct ao_telemetry_satellite_info));
ao_mutex_put(&ao_gps_mutex);
- ao_radio_send(&telemetry, sizeof (telemetry));
ao_telemetry_sat_cur = ao_telemetry_gps_max;
+ ao_telemetry_send();
}
}
#endif
ao_companion_data,
ao_companion_setup.channels * 2);
ao_mutex_put(&ao_companion_mutex);
- ao_radio_send(&telemetry, sizeof (telemetry));
ao_telemetry_companion_cur = ao_telemetry_companion_max;
+ ao_telemetry_send();
}
}
#endif
#endif /* HAS_APRS */
delay = time - ao_time();
if (delay > 0) {
- ao_alarm(delay);
- ao_sleep(&telemetry);
- ao_clear_alarm();
+ ao_sleep_for(&telemetry, delay);
}
}
}