diff options
author | Keith Packard <keithp@keithp.com> | 2017-10-22 15:44:32 -0500 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-10-28 08:42:18 -0700 |
commit | 83929cd290279963b01b2ccd52c70d61bdeff6b0 (patch) | |
tree | 1e76700f3322f9db686c661cbec036d8000510a9 /src/kernel/ao_log_tiny.c | |
parent | 256ddea8c430b4b5dcb8bb95c19ad26032129e1b (diff) |
altos: Share common logging code. Deal with corrupt initial flight records
Move common logging APIs from per-format files into ao_log.c. Then,
change that code to check the first log record in a slot (containing
the flight number) to see if it's invalid and deal with it. That
involves not re-using that slot, and allowing it to be erased.
Corrupted log blocks are reported with a negative flight number.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/kernel/ao_log_tiny.c')
-rw-r--r-- | src/kernel/ao_log_tiny.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/kernel/ao_log_tiny.c b/src/kernel/ao_log_tiny.c index 7769b7b5..0b8e39d6 100644 --- a/src/kernel/ao_log_tiny.c +++ b/src/kernel/ao_log_tiny.c @@ -29,8 +29,6 @@ static __data uint16_t ao_log_tiny_interval; #define AO_PAD_RING 2 #endif -__code uint8_t ao_log_format = AO_LOG_FORMAT_TINY; - void ao_log_tiny_set_interval(uint16_t ticks) { @@ -149,7 +147,7 @@ ao_log(void) } } -uint16_t +int16_t ao_log_flight(uint8_t slot) { static __xdata uint16_t flight; |