summaryrefslogtreecommitdiff
path: root/src/ao_telemetry.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-09-04 11:46:55 -0700
committerKeith Packard <keithp@keithp.com>2009-09-04 11:46:55 -0700
commitfee46389b70a624ab5b1128a8b4c3083c7747bcb (patch)
treeb39de35fd305b26413839c69592de56acbc13fab /src/ao_telemetry.c
parent54545640b0db7747137655f84bc67fd290ecb904 (diff)
Make RDF beacon only run on pad and after landing.
It's pretty much impossible to RDF the rocket during flight, and it interferes with the telemetry data stream. Leave it enabled on the pad so that radios can be tested, and then re-enable it once the rocket has landed. This patch also turns the rdf 'on' time into a parameter so it can be changed, and then sets that parameter to 500ms, once every 5 seconds. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_telemetry.c')
-rw-r--r--src/ao_telemetry.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ao_telemetry.c b/src/ao_telemetry.c
index 7eefee3c..d52e589c 100644
--- a/src/ao_telemetry.c
+++ b/src/ao_telemetry.c
@@ -21,7 +21,8 @@ __xdata uint16_t ao_telemetry_interval = 0;
__xdata uint8_t ao_rdf = 0;
__xdata uint16_t ao_rdf_time;
-#define AO_RDF_INTERVAL AO_SEC_TO_TICKS(3)
+#define AO_RDF_INTERVAL_TICKS AO_SEC_TO_TICKS(5)
+#define AO_RDF_LENGTH_MS 500
void
ao_telemetry(void)
@@ -51,8 +52,8 @@ ao_telemetry(void)
if (ao_rdf &&
(int16_t) (ao_time() - ao_rdf_time) >= 0)
{
- ao_rdf_time = ao_time() + AO_RDF_INTERVAL;
- ao_radio_rdf();
+ ao_rdf_time = ao_time() + AO_RDF_INTERVAL_TICKS;
+ ao_radio_rdf(AO_RDF_LENGTH_MS);
ao_delay(ao_telemetry_interval);
}
}
@@ -71,6 +72,8 @@ ao_rdf_set(uint8_t rdf)
ao_rdf = rdf;
if (rdf == 0)
ao_radio_rdf_abort();
+ else
+ ao_rdf_time = ao_time();
}
__xdata struct ao_task ao_telemetry_task;