X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fkernel%2Fao_telemetry.c;h=27306a344c27a0cdb27b7e2bf19789e1fef4c97f;hp=f4fcf40074684b58956ffcec7984cef3a350c0d6;hb=0cedc27e22a9fbc9ccfe1b403c84d728bb23220d;hpb=ea5887027e7a39da2b7d84a142d74950b7a24703 diff --git a/src/kernel/ao_telemetry.c b/src/kernel/ao_telemetry.c index f4fcf400..27306a34 100644 --- a/src/kernel/ao_telemetry.c +++ b/src/kernel/ao_telemetry.c @@ -1,5 +1,5 @@ /* - * Copyright © 2011 Keith Packard + * Copyright © 2011 Keth Packard * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ static __pdata uint16_t ao_telemetry_interval; #if HAS_RADIO_RATE -static __pdata uint16_t ao_telemetry_desired_interval; +static __xdata uint16_t ao_telemetry_desired_interval; #endif #if HAS_RDF @@ -344,7 +344,7 @@ ao_send_location(void) ao_mutex_get(&ao_gps_mutex); ao_xmemcpy(&telemetry.location.flags, &ao_gps_data.flags, - 26); + 27); telemetry.location.tick = ao_gps_tick; ao_mutex_put(&ao_gps_mutex); ao_radio_send(&telemetry, sizeof (telemetry)); @@ -511,14 +511,14 @@ ao_telemetry_set_interval(uint16_t interval) #if HAS_RADIO_RATE /* Limit max telemetry rate based on available radio bandwidth. */ - static const uint16_t min_interval[] = { + static __xdata const uint16_t min_interval[] = { /* [AO_RADIO_RATE_38400] = */ AO_MS_TO_TICKS(100), /* [AO_RADIO_RATE_9600] = */ AO_MS_TO_TICKS(500), /* [AO_RADIO_RATE_2400] = */ AO_MS_TO_TICKS(1000) }; ao_telemetry_desired_interval = interval; - if (interval < min_interval[ao_config.radio_rate]) + if (interval && interval < min_interval[ao_config.radio_rate]) interval = min_interval[ao_config.radio_rate]; #endif ao_telemetry_interval = interval;