Merge pull request #855 from laqieer/fix/flash_erase

Fix Flash chip's erase operation
This commit is contained in:
Zach Bacon 2021-08-30 23:51:53 -04:00 committed by GitHub
commit 0ea8ce8dd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -172,13 +172,13 @@ void flashWrite(uint32_t address, uint8_t byte)
if (byte == 0x30) {
// SECTOR ERASE
memset(&flashSaveMemory[(flashBank << 16) + (address & 0xF000)],
0,
0xff,
0x1000);
systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED;
flashReadState = FLASH_ERASE_COMPLETE;
} else if (byte == 0x10) {
// CHIP ERASE
memset(flashSaveMemory, 0, flashSize);
memset(flashSaveMemory, 0xff, flashSize);
systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED;
flashReadState = FLASH_ERASE_COMPLETE;
} else {