diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-10-28 22:54:41 -0400 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2021-11-08 19:45:14 -0500 |
commit | adf773f1ed272f31ae34e2613d20ec796b651bf8 (patch) | |
tree | 24a946647d042ac4551865c9865763698223a298 /src/save_failed_screen.c | |
parent | ab1074e629da97a7a68cc1babc0f4840858adb1b (diff) |
Document remainder of save.c
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++) |