X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fao_telemetry.c;h=dcd0ff625926a376fd62ab2f96f6d5e9200e8d28;hb=6903b6464db7eb803de8bf9b897c45431f7a1d63;hp=94ea0b2235bcffbc8acf79835d60d5112a2c3e63;hpb=ef3ce687d73c1274ce5368432f4d449b063ce5c0;p=fw%2Faltos diff --git a/src/ao_telemetry.c b/src/ao_telemetry.c index 94ea0b22..dcd0ff62 100644 --- a/src/ao_telemetry.c +++ b/src/ao_telemetry.c @@ -18,15 +18,15 @@ #include "ao.h" #include "ao_product.h" -__xdata uint16_t ao_telemetry_interval; -__xdata int8_t ao_telemetry_config_max; -__xdata int8_t ao_telemetry_config_cur; +static __pdata uint16_t ao_telemetry_interval; +static __pdata int8_t ao_telemetry_config_max; +static __pdata int8_t ao_telemetry_config_cur; #if HAS_GPS -__xdata int8_t ao_telemetry_loc_cur; -__xdata int8_t ao_telemetry_sat_cur; +static __pdata int8_t ao_telemetry_loc_cur; +static __pdata int8_t ao_telemetry_sat_cur; #endif -__xdata uint8_t ao_rdf = 0; -__xdata uint16_t ao_rdf_time; +static __pdata uint8_t ao_rdf = 0; +static __pdata uint16_t ao_rdf_time; #define AO_RDF_INTERVAL_TICKS AO_SEC_TO_TICKS(5) #define AO_RDF_LENGTH_MS 500 @@ -94,8 +94,9 @@ ao_send_configuration(void) telemetry.configuration.flight = ao_flight_number; telemetry.configuration.config_major = AO_CONFIG_MAJOR; telemetry.configuration.config_minor = AO_CONFIG_MINOR; + telemetry.configuration.apogee_delay = ao_config.apogee_delay; telemetry.configuration.main_deploy = ao_config.main_deploy; - telemetry.configuration.flight_log_max = ao_config.flight_log_max; + telemetry.configuration.flight_log_max = ao_config.flight_log_max >> 10; memcpy (telemetry.configuration.callsign, ao_config.callsign, AO_MAX_CALLSIGN); @@ -155,7 +156,7 @@ ao_telemetry(void) telemetry.generic.serial = ao_serial_number; for (;;) { while (ao_telemetry_interval == 0) - ao_sleep(&ao_telemetry_interval); + ao_sleep(&telemetry); time = ao_rdf_time = ao_time(); while (ao_telemetry_interval) { @@ -196,7 +197,7 @@ ao_telemetry_set_interval(uint16_t interval) if (ao_telemetry_config_max - 1 > ao_telemetry_sat_cur) ao_telemetry_sat_cur++; #endif - ao_wakeup(&ao_telemetry_interval); + ao_wakeup(&telemetry); } void