Fix Flash chip's erase operation: erased memory is FFh-filled, not zero-filled.
This commit is contained in:
parent
c08bb6bdb0
commit
18e387d165
|
@ -172,13 +172,13 @@ void flashWrite(uint32_t address, uint8_t byte)
|
||||||
if (byte == 0x30) {
|
if (byte == 0x30) {
|
||||||
// SECTOR ERASE
|
// SECTOR ERASE
|
||||||
memset(&flashSaveMemory[(flashBank << 16) + (address & 0xF000)],
|
memset(&flashSaveMemory[(flashBank << 16) + (address & 0xF000)],
|
||||||
0,
|
0xff,
|
||||||
0x1000);
|
0x1000);
|
||||||
systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED;
|
systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED;
|
||||||
flashReadState = FLASH_ERASE_COMPLETE;
|
flashReadState = FLASH_ERASE_COMPLETE;
|
||||||
} else if (byte == 0x10) {
|
} else if (byte == 0x10) {
|
||||||
// CHIP ERASE
|
// CHIP ERASE
|
||||||
memset(flashSaveMemory, 0, flashSize);
|
memset(flashSaveMemory, 0xff, flashSize);
|
||||||
systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED;
|
systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED;
|
||||||
flashReadState = FLASH_ERASE_COMPLETE;
|
flashReadState = FLASH_ERASE_COMPLETE;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue