MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / flash_erase

Function flash_erase

core/mem.c:188–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188static void flash_erase(uint32_t addr, uint8_t byte) {
189 unsigned int i;
190 (void)addr;
191 (void)byte;
192
193 mem.flash.command = FLASH_CHIP_ERASE;
194
195 for (i = 0; i < NUM_8K_SECTORS; i++) {
196 if ((mem.flash.sector8k[i].ipb & mem.flash.sector8k[i].dpb) == 1) {
197 memset(mem.flash.sector8k[i].ptr, 0xFF, SIZE_FLASH_SECTOR_8K);
198 }
199 }
200
201 for (i = 0; i < NUM_SECTORS; i++) {
202 if ((mem.flash.sector[i].ipb & mem.flash.sector[i].dpb) == 1) {
203 memset(mem.flash.sector[i].ptr, 0xFF, SIZE_FLASH_SECTOR_64K);
204 }
205 }
206
207 gui_console_printf("[CEmu] Erased Unlocked Sectors.\n");
208}
209
210static void flash_erase_sector(uint32_t addr, uint8_t byte) {
211 unsigned int selected;

Callers

nothing calls this directly

Calls 1

gui_console_printfFunction · 0.50

Tested by

no test coverage detected