From: Keith Packard Date: Sat, 17 Aug 2013 15:36:35 +0000 (+0200) Subject: altos: allow projects to override default config values X-Git-Tag: 1.2.9.4~140 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=e0a0a747624c2df66ca4a73b5a0de014ea204dca altos: allow projects to override default config values Override default radio power and APRS interval Signed-off-by: Keith Packard --- diff --git a/src/core/ao_config.c b/src/core/ao_config.c index 1a500c79..b480e14c 100644 --- a/src/core/ao_config.c +++ b/src/core/ao_config.c @@ -28,6 +28,9 @@ __pdata uint8_t ao_config_loaded; __pdata uint8_t ao_config_dirty; __xdata uint8_t ao_config_mutex; +#ifndef AO_CONFIG_DEFAULT_APRS_INTERVAL +#define AO_CONFIG_DEFAULT_APRS_INTERVAL 0 +#endif #define AO_CONFIG_DEFAULT_MAIN_DEPLOY 250 #define AO_CONFIG_DEFAULT_RADIO_CHANNEL 0 #define AO_CONFIG_DEFAULT_CALLSIGN "N0CALL" @@ -47,7 +50,9 @@ __xdata uint8_t ao_config_mutex; #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX ((uint32_t) 192 * (uint32_t) 1024) #endif #endif +#ifndef AO_CONFIG_DEFAULT_RADIO_POWER #define AO_CONFIG_DEFAULT_RADIO_POWER 0x60 +#endif #define AO_CONFIG_DEFAULT_RADIO_AMP 0 #if HAS_EEPROM @@ -142,7 +147,7 @@ _ao_config_get(void) memset(&ao_config.pyro, '\0', sizeof (ao_config.pyro)); #endif if (minor < 13) - ao_config.aprs_interval = 0; + ao_config.aprs_interval = AO_CONFIG_DEFAULT_APRS_INTERVAL; #if HAS_RADIO_POWER if (minor < 14) ao_config.radio_power = AO_CONFIG_DEFAULT_RADIO_POWER; diff --git a/src/core/ao_telemetry.c b/src/core/ao_telemetry.c index c3bbfec5..dfde2235 100644 --- a/src/core/ao_telemetry.c +++ b/src/core/ao_telemetry.c @@ -198,7 +198,11 @@ ao_send_configuration(void) { telemetry.generic.type = AO_TELEMETRY_CONFIGURATION; telemetry.configuration.device = AO_idProduct_NUMBER; +#if HAS_LOG telemetry.configuration.flight = ao_log_full() ? 0 : ao_flight_number; +#else + telemetry.configuration.flight = ao_flight_number; +#endif telemetry.configuration.config_major = AO_CONFIG_MAJOR; telemetry.configuration.config_minor = AO_CONFIG_MINOR; telemetry.configuration.apogee_delay = ao_config.apogee_delay;