From 4d51570ed8776461d084726149923c5be43d622e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 25 Oct 2014 19:56:25 -0700 Subject: altos: Fix up telemetry delay computations With RDF, APRS and telemetry all being sent at varying rates, computing when to send the next radio data is not as simple as sending telemetry and then figuring out whether to send RDF and/or APRS. Fix this by computing times for the next telemetry/rdf/aprs packet, and only sending each when that time has passed. Compute the delay until the next radio activity as the minimum time to any transmission. This also adds code to the config bits to reset the radio times whenever something changes that might affect which radio data to send next. Signed-off-by: Keith Packard --- src/kernel/ao_telemetry.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/kernel/ao_telemetry.h') diff --git a/src/kernel/ao_telemetry.h b/src/kernel/ao_telemetry.h index 340c388e..711e0d36 100644 --- a/src/kernel/ao_telemetry.h +++ b/src/kernel/ao_telemetry.h @@ -120,6 +120,12 @@ struct ao_telemetry_location { #define HAS_WIDE_GPS 1 #endif +#ifdef HAS_TELEMETRY +#ifndef HAS_RDF +#define HAS_RDF 1 +#endif +#endif + #if HAS_WIDE_GPS typedef int32_t gps_alt_t; #define AO_TELEMETRY_LOCATION_ALTITUDE(l) (((gps_alt_t) (l)->altitude_high << 16) | ((l)->altitude_low)) -- cgit v1.2.3