From d8c9684239b67a69a4a3d24202a6df0d73c4f7f5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 7 Jan 2011 17:54:54 -0800 Subject: 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 --- src/ao_flash.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/ao_flash.c') 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); -- cgit v1.2.3