summaryrefslogtreecommitdiff
path: root/src/ao_ee.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-01-06 17:34:58 -0800
committerKeith Packard <keithp@keithp.com>2011-01-06 17:34:58 -0800
commite4ba9bf4291bf17c777c8c3ef7c71e4a30b9947a (patch)
tree93aa37af44852d21ddc4c2924cf49b07bbf905e5 /src/ao_ee.c
parentddcc94da4326f9ce954bd31a46b36165c58e6c18 (diff)
altos: Require manual flight erasing.
This supports flash chips that require larger erase blocks. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_ee.c')
-rw-r--r--src/ao_ee.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ao_ee.c b/src/ao_ee.c
index 6fe88252..575a7b30 100644
--- a/src/ao_ee.c
+++ b/src/ao_ee.c
@@ -246,6 +246,18 @@ ao_storage_flush(void) __reentrant
} ao_mutex_put(&ao_ee_mutex);
}
+uint8_t
+ao_storage_erase(uint32_t pos) __reentrant
+{
+ ao_mutex_get(&ao_ee_mutex); {
+ uint16_t block = (uint16_t) (pos >> 8);
+ ao_ee_fill(block);
+ memset(ao_ee_data, 0xff, EE_BLOCK_SIZE);
+ ao_ee_block_dirty = 1;
+ } ao_mutex_put(&ao_ee_mutex);
+ return 1;
+}
+
static void
ee_dump(void) __reentrant
{