altos: Handle flight_log_max not being multiple of ao_storage_block
authorKeith Packard <keithp@keithp.com>
Tue, 9 Jun 2020 04:05:17 +0000 (21:05 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 9 Jun 2020 04:17:55 +0000 (21:17 -0700)
commitc246a366a6e0117e70abafc30db71c0545b88f6f
tree340b86896d8cf20db107508ef6a8f432df20d355
parent89726f5b1adceb243c5e2d5c958fc13c10f9a2d0
altos: Handle flight_log_max not being multiple of ao_storage_block

In this case, flight records start in the middle of an erase block, but
now end at the erase block before the next flight.

When checking for an empty log slot, the entire erase block containing
the start of the flight is checked to make sure it's clear, skipping
it if not.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_log.c
src/kernel/ao_log.h
src/kernel/ao_log_gps.c