summaryrefslogtreecommitdiff
path: root/src/ao_flash.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-01-07 17:54:54 -0800
committerKeith Packard <keithp@keithp.com>2011-01-07 17:54:54 -0800
commitd8c9684239b67a69a4a3d24202a6df0d73c4f7f5 (patch)
treeafe02b38915ca1468e71cbdf305fdfe9a39a8399 /src/ao_flash.c
parent2722703bd848b07a02d3ce0c83a502eca52a9f1d (diff)
altos: Speed up at45 and 25lc erase speeds
No need to read the block to be erased before erasing it. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_flash.c')
-rw-r--r--src/ao_flash.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ao_flash.c b/src/ao_flash.c
index 1201a0e5..3a264ceb 100644
--- a/src/ao_flash.c
+++ b/src/ao_flash.c
@@ -289,10 +289,9 @@ ao_storage_flush(void) __reentrant
uint8_t
ao_storage_erase(uint32_t pos) __reentrant
{
- uint16_t block = (uint16_t) (pos >> ao_flash_block_shift);
-
ao_mutex_get(&ao_flash_mutex); {
- ao_flash_fill(block);
+ ao_flash_flush_internal();
+ ao_flash_block = (uint16_t) (pos >> ao_flash_block_shift);
memset(ao_flash_data, 0xff, ao_flash_block_size);
ao_flash_block_dirty = 1;
} ao_mutex_put(&ao_flash_mutex);