summaryrefslogtreecommitdiff
path: root/src/ao_log.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-01-06 22:37:38 -0800
committerKeith Packard <keithp@keithp.com>2011-01-06 22:37:38 -0800
commit569a1dac55b70c30f01afa7bcb74442ecdd85d85 (patch)
tree197d6048f3b6694aeaf1f23f4605d494757902f5 /src/ao_log.c
parente4ba9bf4291bf17c777c8c3ef7c71e4a30b9947a (diff)
altos: Move common storage code to ao_storage.c. Add M25P80 driver
This reworks the storage API so that you erase blocks and then store data to them so that the M25P80 driver will work. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_log.c')
-rw-r--r--src/ao_log.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ao_log.c b/src/ao_log.c
index 132512e6..9ca033e1 100644
--- a/src/ao_log.c
+++ b/src/ao_log.c
@@ -168,7 +168,7 @@ ao_log_erase_pos(uint8_t i)
return i * sizeof (struct ao_log_erase) + AO_STORAGE_ERASE_LOG;
}
-static void
+void
ao_log_write_erase(uint8_t pos)
{
erase.unused = 0x00;
@@ -364,13 +364,16 @@ ao_log_delete(void) __reentrant
ao_storage_erase(ao_log_current_pos);
ao_log_current_pos += ao_storage_block;
}
- puts("Erased\n");
+ puts("Erased");
return;
}
}
+ ao_log_erase_mark();
printf("No such flight: %d\n", ao_cmd_lex_i);
}
+
+
__code struct ao_cmds ao_log_cmds[] = {
{ 'l', ao_log_list, "l List stored flight logs" },
{ 'd', ao_log_delete, "d <flight-number> Delete stored flight" },