projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Decrease telemetry rate on the pad to 1/sec instead of 20/sec
[fw/altos]
/
ao_flight.c
diff --git
a/ao_flight.c
b/ao_flight.c
index 06d4ba3d6891f1fc99ecbf0c555cf09df8bea711..f4b5279b64cf1edecc57d88986c5ebb2df89807a 100644
(file)
--- a/
ao_flight.c
+++ b/
ao_flight.c
@@
-136,7
+136,7
@@
__xdata int32_t ao_raw_accel_sum, ao_raw_pres_sum;
void
ao_flight(void)
{
void
ao_flight(void)
{
- __pdata static uint
8_t
nsamples = 0;
+ __pdata static uint
16_t
nsamples = 0;
ao_flight_adc = ao_adc_head;
ao_raw_accel_prev = 0;
ao_flight_adc = ao_adc_head;
ao_raw_accel_prev = 0;
@@
-194,10
+194,10
@@
ao_flight(void)
/* startup state:
*
/* startup state:
*
- * Collect 100 samples of acceleration and pressure
+ * Collect 100
0
samples of acceleration and pressure
* data and average them to find the resting values
*/
* data and average them to find the resting values
*/
- if (nsamples < 100) {
+ if (nsamples < 100
0
) {
ao_raw_accel_sum += ao_raw_accel;
ao_raw_pres_sum += ao_raw_pres;
++nsamples;
ao_raw_accel_sum += ao_raw_accel;
ao_raw_pres_sum += ao_raw_pres;
++nsamples;
@@
-223,7
+223,7
@@
ao_flight(void)
/* Turn on telemetry system
*/
ao_rdf_set(1);
/* Turn on telemetry system
*/
ao_rdf_set(1);
- ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_
FLIGHT
);
+ ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_
PAD
);
ao_flight_state = ao_flight_launchpad;
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
ao_flight_state = ao_flight_launchpad;
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
@@
-259,6
+259,9
@@
ao_flight(void)
/* start logging data */
ao_log_start();
/* start logging data */
ao_log_start();
+ /* Increase telemetry rate */
+ ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_FLIGHT);
+
/* disable RDF beacon */
ao_rdf_set(0);
/* disable RDF beacon */
ao_rdf_set(0);