diff options
author | Keith Packard <keithp@keithp.com> | 2011-01-06 17:34:58 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-01-06 17:34:58 -0800 |
commit | e4ba9bf4291bf17c777c8c3ef7c71e4a30b9947a (patch) | |
tree | 93aa37af44852d21ddc4c2924cf49b07bbf905e5 /src/ao_flash.c | |
parent | ddcc94da4326f9ce954bd31a46b36165c58e6c18 (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_flash.c')
-rw-r--r-- | src/ao_flash.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ao_flash.c b/src/ao_flash.c index 3a06bae1..bc8b56ad 100644 --- a/src/ao_flash.c +++ b/src/ao_flash.c @@ -322,6 +322,18 @@ ao_storage_flush(void) __reentrant } ao_mutex_put(&ao_flash_mutex); } +uint8_t +ao_storage_erase(uint32_t pos) __reentrant +{ + ao_mutex_get(&ao_flash_mutex); { + uint16_t block = (uint16_t) (pos >> ao_flash_block_shift); + ao_flash_fill(block); + memset(ao_flash_data, 0xff, ao_flash_block_size); + ao_flash_block_dirty = 1; + } ao_mutex_put(&ao_flash_mutex); + return 1; +} + static void flash_dump(void) __reentrant { |