From 81cf2e833bedbc1ace8fd310e9e94bfb7673d428 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 6 Jul 2011 16:43:17 -0700 Subject: [PATCH] altos: Ensure low-rate telem packets interleave with sensor telem packets 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 --- src/ao_telemetry.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ao_telemetry.c b/src/ao_telemetry.c index 603a6791..172b6f17 100644 --- a/src/ao_telemetry.c +++ b/src/ao_telemetry.c @@ -194,13 +194,13 @@ ao_telemetry_set_interval(uint16_t interval) { 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); -- 2.30.2