summaryrefslogtreecommitdiff
path: root/ao_telemetry.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-04-26 00:11:32 -0700
committerKeith Packard <keithp@keithp.com>2009-04-26 00:11:32 -0700
commit38a0b61b0a0b3c00f064c8d562950a17a6ddff4a (patch)
treeee099db3cfa30d5fe7a94523fe1e7a46f64d238d /ao_telemetry.c
parentc65f1a1acd2ca00758833cec5d3f8056d303d3e2 (diff)
Add configuration support
Current config variables: Main deploy altitude above launch (in meters) Acceleration zero g calibration (manual or automatic) Radio channel (freq = 435.550MHz + channel * 100kHz) Callsign (max 8 characters) Supporting this involved shuffling code around so that the non-telemetrum builds could include only the stuff they needed.
Diffstat (limited to 'ao_telemetry.c')
-rw-r--r--ao_telemetry.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ao_telemetry.c b/ao_telemetry.c
index ffee9bee..db2cfda0 100644
--- a/ao_telemetry.c
+++ b/ao_telemetry.c
@@ -18,12 +18,8 @@
#include "ao.h"
/* XXX make serial numbers real */
-
__xdata uint8_t ao_serial_number = 2;
-/* XXX make callsigns real */
-__xdata char ao_callsign[AO_MAX_CALLSIGN] = "KD7SQG";
-
__xdata uint16_t ao_telemetry_interval = 0;
__xdata uint8_t ao_rdf = 0;
__xdata uint16_t ao_rdf_time;
@@ -35,8 +31,9 @@ ao_telemetry(void)
{
static __xdata struct ao_telemetry telemetry;
+ ao_config_get();
+ memcpy(telemetry.callsign, ao_config.callsign, AO_MAX_CALLSIGN);
telemetry.addr = ao_serial_number;
- memcpy(telemetry.callsign, ao_callsign, AO_MAX_CALLSIGN);
ao_rdf_time = ao_time();
for (;;) {
while (ao_telemetry_interval == 0)
@@ -53,6 +50,7 @@ ao_telemetry(void)
{
ao_rdf_time = ao_time() + AO_RDF_INTERVAL;
ao_radio_rdf();
+ ao_delay(ao_telemetry_interval);
}
}
}