diff options
author | Keith Packard <keithp@keithp.com> | 2011-07-06 16:43:17 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-07-06 16:43:17 -0700 |
commit | 81cf2e833bedbc1ace8fd310e9e94bfb7673d428 (patch) | |
tree | 2d7ed4cdc8418d34d0784f1239c9deda50175af4 /src | |
parent | 5ca6400fd8a360b64d8f96f50d5595a7fd17762d (diff) |
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 <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/ao_telemetry.c | 8 |
1 files 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); |