Implement ms timer and fix all timers
This will fix everything that uses a timer (or sleep). Without this any function like eMMC/SD read/write/verify, TSEC/SE, etc can break when the time reaches the max value of the u32 microsecond timer (71minutes). This fixes every possible breakage, including backup and restore (read/write/verify errors) that takes a lot of time. The new max before a timer reset is now 48 days (the old one was 71 minutes)
This commit is contained in:
@@ -26,7 +26,7 @@ static void _i2c_wait(vu32 *base)
|
||||
base[0x23] = 0x25;
|
||||
for (u32 i = 0; i < 20; i++)
|
||||
{
|
||||
sleep(1);
|
||||
usleep(1);
|
||||
if (!(base[0x23] & 1))
|
||||
break;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ void i2c_init(u32 idx)
|
||||
|
||||
for (u32 i = 0; i < 10; i++)
|
||||
{
|
||||
sleep(20000);
|
||||
usleep(20000);
|
||||
if (base[0x1A] & 0x800)
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user