Mercurial > ecos-v2_0-branch
diff packages/io/flash/current/src/flash.c @ 117:bd1a71e3e476 ecos-sw-2000-08-25
Merge from eCos master repository on 2000-08-25-19:22:58-BST
| author | jlarmour |
|---|---|
| date | Fri, 25 Aug 2000 19:17:22 +0000 |
| parents | 6ed91473a1cd |
| children | 77cec8369160 |
line wrap: on
line diff
--- a/packages/io/flash/current/src/flash.c +++ b/packages/io/flash/current/src/flash.c @@ -57,7 +57,7 @@ flash_init(void *work_space, int work_sp if (flash_info.init) return FLASH_ERR_OK; flash_info.work_space = work_space; - flash_info.work_space_size = flash_info.work_space_size; + flash_info.work_space_size = work_space_size; if ((err = flash_hwr_init()) != FLASH_ERR_OK) { return err; } @@ -121,6 +121,7 @@ flash_erase(void *addr, int len, void ** _flash_erase_block = (code_fun *)flash_info.work_space; memcpy(_flash_erase_block, &flash_erase_block, code_len); HAL_DCACHE_SYNC(); // Should guarantee this code will run + HAL_ICACHE_DISABLE(); // is also required to avoid old contents block = (unsigned short *)((unsigned long)addr & flash_info.block_mask); end_addr = (unsigned short *)((unsigned long)addr+len); @@ -137,6 +138,7 @@ flash_erase(void *addr, int len, void ** block += flash_info.block_size / sizeof(*block); printf("."); } + HAL_ICACHE_ENABLE(); printf("\n"); return (stat); } @@ -161,6 +163,7 @@ flash_program(void *_addr, void *_data, _flash_program_buf = (code_fun *)flash_info.work_space; memcpy(_flash_program_buf, &flash_program_buf, code_len); HAL_DCACHE_SYNC(); // Should guarantee this code will run + HAL_ICACHE_DISABLE(); // is also required to avoid old contents printf("... Program from %p-%p at %p: ", data, ((unsigned long)data)+len, addr); @@ -178,6 +181,7 @@ flash_program(void *_addr, void *_data, addr += size/sizeof(*addr); data += size/sizeof(*data); } + HAL_ICACHE_ENABLE(); printf("\n"); return (stat); }
