summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-10-09 10:21:56 -0600
committerKeith Packard <keithp@keithp.com>2011-10-09 10:21:56 -0600
commit636b7b368e67346b0796cd84fbfd71e10966d61f (patch)
tree9ba893bf5243366b8fbefe0bf79f386740699d81
parentca036c5616c3e745c0b878ed90618d4ff710c0e5 (diff)
altos: Respond to telemetry rate changes immediately
Instead of waiting for the previous telemetry interval to expire, immediately switch to the new telemetry rate. This will provide more telemetry data early in the boost. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/core/ao_telemetry.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/ao_telemetry.c b/src/core/ao_telemetry.c
index 95e53917..d909bea5 100644
--- a/src/core/ao_telemetry.c
+++ b/src/core/ao_telemetry.c
@@ -240,8 +240,11 @@ ao_telemetry(void)
#endif
time += ao_telemetry_interval;
delay = time - ao_time();
- if (delay > 0)
- ao_delay(delay);
+ if (delay > 0) {
+ ao_alarm(delay);
+ ao_sleep(&telemetry);
+ ao_clear_alarm();
+ }
else
time = ao_time();
}