summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-08-17 17:36:35 +0200
committerKeith Packard <keithp@keithp.com>2013-08-17 17:36:35 +0200
commite0a0a747624c2df66ca4a73b5a0de014ea204dca (patch)
tree81783f8a8cfe4bd73ef74e5dbba8fba6c7865bd3 /src
parentbed68ef5a6999b2e23853958502a689a7dbc15b3 (diff)
altos: allow projects to override default config values
Override default radio power and APRS interval Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/ao_config.c7
-rw-r--r--src/core/ao_telemetry.c4
2 files changed, 10 insertions, 1 deletions
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;