projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change .gitignore to match new aoload procedure
[fw/altos]
/
ao_log.c
diff --git
a/ao_log.c
b/ao_log.c
index bcd852c0bc5089780eb5fa38889575c592f11757..107c4323b53d41cab23df34a9324e8d99e23fc6c 100644
(file)
--- a/
ao_log.c
+++ b/
ao_log.c
@@
-121,13
+121,15
@@
ao_log(void)
log.type = AO_LOG_FLIGHT;
log.tick = ao_flight_tick;
log.type = AO_LOG_FLIGHT;
log.tick = ao_flight_tick;
- log.u.flight.
serial = 0
;
+ log.u.flight.
ground_accel = ao_ground_accel
;
log.u.flight.flight = ao_log_dump_flight + 1;
ao_log_data(&log);
log.u.flight.flight = ao_log_dump_flight + 1;
ao_log_data(&log);
- for (;;) {
- while (!ao_log_running)
- ao_sleep(&ao_log_running);
+ /* Write the whole contents of the ring to the log
+ * when starting up.
+ */
+ ao_log_adc_pos = ao_adc_ring_next(ao_adc_head);
+ for (;;) {
/* Write samples to EEPROM */
while (ao_log_adc_pos != ao_adc_head) {
log.type = AO_LOG_SENSOR;
/* Write samples to EEPROM */
while (ao_log_adc_pos != ao_adc_head) {
log.type = AO_LOG_SENSOR;
@@
-164,6
+166,10
@@
ao_log(void)
/* Wait for a while */
ao_delay(AO_MS_TO_TICKS(100));
/* Wait for a while */
ao_delay(AO_MS_TO_TICKS(100));
+
+ /* Stop logging when told to */
+ while (!ao_log_running)
+ ao_sleep(&ao_log_running);
}
}
}
}