altos/telegps-*: Fix log end discovery at startup
authorKeith Packard <keithp@keithp.com>
Tue, 18 May 2021 05:33:21 +0000 (22:33 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 19 May 2021 05:53:51 +0000 (22:53 -0700)
commit8dec0d1be5a2d7633045c5c0e86b32a9e6b60299
tree2f175515a722ee9e03a1a38f2626b151d2b27c95
parentfa273e51e772540f61fffbdc4431fe07bcd57630
altos/telegps-*: Fix log end discovery at startup

We need to find the first unwritten log block to start appending data,
but the code was actually looking for the first empty 256-byte chunk,
which meant that we'd leave a gap of erased data after the previous
log. AltosUI would stop at that point and not recover the remaining
stored data.

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