diff options
author | Bdale Garbee <bdale@gag.com> | 2013-12-19 01:38:40 -0700 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2013-12-19 01:38:40 -0700 |
commit | 575bbaf976c5840fd0e308549c45a466fdec1352 (patch) | |
tree | 11bfb498348bf7687bffc24699c4b1a998988ee4 /src/core/ao_log.c | |
parent | b825116df173b77e2cab217a7b76112c742f9279 (diff) | |
parent | bc3610d8cecbfed40c62d4dcb93fc9a4d2a7c9e3 (diff) |
Merge branch 'branch-1.3' into debian
Conflicts:
ChangeLog
altoslib/AltosRecordMM.java
altosui/Makefile.am
altosui/altos-windows.nsi.in
configure.ac
debian/changelog
debian/control
doc/Makefile
doc/altusmetrum.xsl
doc/release-notes-1.2.1.xsl
doc/release-notes-1.2.xsl
Diffstat (limited to 'src/core/ao_log.c')
-rw-r--r-- | src/core/ao_log.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/ao_log.c b/src/core/ao_log.c index 7884ec3c..701c81ab 100644 --- a/src/core/ao_log.c +++ b/src/core/ao_log.c @@ -17,6 +17,7 @@ #include "ao.h" #include <ao_log.h> +#include <ao_config.h> __pdata uint32_t ao_log_current_pos; __pdata uint32_t ao_log_end_pos; @@ -48,7 +49,7 @@ static __xdata struct ao_log_erase erase; static uint32_t ao_log_erase_pos(uint8_t i) { - return i * sizeof (struct ao_log_erase) + AO_STORAGE_ERASE_LOG; + return i * sizeof (struct ao_log_erase) + AO_CONFIG_MAX_SIZE; } void @@ -56,14 +57,14 @@ ao_log_write_erase(uint8_t pos) { erase.unused = 0x00; erase.flight = ao_flight_number; - ao_storage_write(ao_log_erase_pos(pos), &erase, sizeof (erase)); - ao_storage_flush(); + ao_config_write(ao_log_erase_pos(pos), &erase, sizeof (erase)); + ao_config_flush(); } static void ao_log_read_erase(uint8_t pos) { - ao_storage_read(ao_log_erase_pos(pos), &erase, sizeof (erase)); + ao_config_read(ao_log_erase_pos(pos), &erase, sizeof (erase)); } @@ -87,7 +88,7 @@ ao_log_erase_mark(void) static uint8_t ao_log_slots() { - return (uint8_t) (ao_storage_config / ao_config.flight_log_max); + return (uint8_t) (ao_storage_log_max / ao_config.flight_log_max); } uint32_t @@ -278,6 +279,11 @@ ao_log_init(void) ao_cmd_register(&ao_log_cmds[0]); +#ifndef HAS_ADC +#error Define HAS_ADC for ao_log.c +#endif +#if HAS_ADC /* Create a task to log events to eeprom */ ao_add_task(&ao_log_task, ao_log, "log"); +#endif } |