To avoid over-committing the radio link, we want to send only
one low rate packet after each sensor packet. However, the
initializations for this were incorrect, causing the configuration and
location packets to be sent at the same time.
Signed-off-by: Keith Packard <keithp@keithp.com>
{
ao_telemetry_interval = interval;
ao_telemetry_config_max = AO_SEC_TO_TICKS(1) / interval;
- ao_telemetry_config_cur = 0;
+ ao_telemetry_config_cur = 1;
#if HAS_GPS
- ao_telemetry_loc_cur = 0;
- if (ao_telemetry_config_max - 1 > ao_telemetry_loc_cur)
+ ao_telemetry_loc_cur = 1;
+ if (ao_telemetry_config_max > ao_telemetry_loc_cur)
ao_telemetry_loc_cur++;
ao_telemetry_sat_cur = ao_telemetry_loc_cur;
- if (ao_telemetry_config_max - 1 > ao_telemetry_sat_cur)
+ if (ao_telemetry_config_max > ao_telemetry_sat_cur)
ao_telemetry_sat_cur++;
#endif
ao_wakeup(&telemetry);