diff options
Diffstat (limited to 'src/save_failed_screen.c')
-rw-r--r-- | src/save_failed_screen.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 4f0373270..ff8c92b33 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -363,9 +363,10 @@ static bool8 VerifySectorWipe(u16 sector) ReadFlash(sector, 0, (u8 *)ptr, SECTOR_SIZE); - for (i = 0; i < 0x400; i++, ptr++) + // 1/4 because ptr is u32 + for (i = 0; i < SECTOR_SIZE / 4; i++, ptr++) if (*ptr) - return TRUE; + return TRUE; // Sector has nonzero data, failed return FALSE; } @@ -375,6 +376,7 @@ static bool8 WipeSector(u16 sector) u16 i, j; bool8 failed = TRUE; + // Attempt to wipe sector with an arbitrary attempt limit of 130 for (i = 0; failed && i < 130; i++) { for (j = 0; j < SECTOR_SIZE; j++) |