projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/micropeak-v2: Erase log space at end of BOOST_DELAY
[fw/altos]
/
src
/
micropeak-v2.0
/
ao_micropeak.c
diff --git
a/src/micropeak-v2.0/ao_micropeak.c
b/src/micropeak-v2.0/ao_micropeak.c
index dd86ba1c70c2368fbbde98da38a7194bc79a8491..0b9972e908b1687e8741f2187fed64211b056806 100644
(file)
--- a/
src/micropeak-v2.0/ao_micropeak.c
+++ b/
src/micropeak-v2.0/ao_micropeak.c
@@
-164,6
+164,13
@@
ao_battery_voltage(void)
return 330 * stm_cal.vrefint_cal / vrefint;
}
return 330 * stm_cal.vrefint_cal / vrefint;
}
+static void
+ao_log_erase(void)
+{
+ uint32_t pos;
+ for (pos = 0; pos < ao_storage_log_max; pos += ao_storage_block)
+ ao_storage_erase(pos);
+}
uint8_t ao_on_battery;
uint8_t ao_on_battery;
@@
-186,6
+193,7
@@
ao_micropeak(void)
#if BOOST_DELAY
ao_delay(BOOST_DELAY);
#endif
#if BOOST_DELAY
ao_delay(BOOST_DELAY);
#endif
+ ao_log_erase();
ao_microflight();
ao_microflight();
@@
-239,9
+247,7
@@
ao_log_delete(void)
/* Look for the flight log matching the requested flight */
if (cmd_flight == 1 && ao_log_present()) {
/* Look for the flight log matching the requested flight */
if (cmd_flight == 1 && ao_log_present()) {
- uint32_t pos;
- for (pos = 0; pos < ao_storage_log_max; pos += ao_storage_block)
- ao_storage_erase(pos);
+ ao_log_erase();
puts("Erased");
return;
}
puts("Erased");
return;
}