projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Clean up warnings for LPC products
[fw/altos]
/
src
/
core
/
ao_log.c
diff --git
a/src/core/ao_log.c
b/src/core/ao_log.c
index 7884ec3cde155a88102e56db5905f2e57535ae95..20febefe27f2df4693ad4cd02b6f31b96aaa20ea 100644
(file)
--- 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.h"
#include <ao_log.h>
+#include <ao_config.h>
__pdata uint32_t ao_log_current_pos;
__pdata uint32_t ao_log_end_pos;
__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)
{
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
}
void
@@
-56,14
+57,14
@@
ao_log_write_erase(uint8_t pos)
{
erase.unused = 0x00;
erase.flight = ao_flight_number;
{
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)
{
}
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()
{
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
}
uint32_t
@@
-195,7
+196,9
@@
ao_log_full(void)
return ao_log_current_pos == ao_log_end_pos;
}
return ao_log_current_pos == ao_log_end_pos;
}
+#if HAS_ADC
static __xdata struct ao_task ao_log_task;
static __xdata struct ao_task ao_log_task;
+#endif
void
ao_log_list(void) __reentrant
void
ao_log_list(void) __reentrant
@@
-278,6
+281,11
@@
ao_log_init(void)
ao_cmd_register(&ao_log_cmds[0]);
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");
/* Create a task to log events to eeprom */
ao_add_task(&ao_log_task, ao_log, "log");
+#endif
}
}