Document remainder of save.c
This commit is contained in:
@@ -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++)
|
||||
|
||||
Reference in New Issue
Block a user