(hopefully) fixed a problem with hang when i2c communication to TFP410 fails
This commit is contained in:
1496
sys/sysinit.c
1496
sys/sysinit.c
File diff suppressed because it is too large
Load Diff
@@ -33,6 +33,7 @@ uint32_t get_timer(void)
|
|||||||
{
|
{
|
||||||
return MCF_SLT_SCNT(0);
|
return MCF_SLT_SCNT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wait for the specified number of us on slice timer 0. Replaces the original routines that had
|
* wait for the specified number of us on slice timer 0. Replaces the original routines that had
|
||||||
* the number of useconds to wait for hardcoded in their name.
|
* the number of useconds to wait for hardcoded in their name.
|
||||||
@@ -52,8 +53,8 @@ void wait_ms(uint32_t ms)
|
|||||||
wait(ms * 1000);
|
wait(ms * 1000);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* the same as above, with a checker function which gets called while
|
* wait for the specified number of us (same as above), but with a checker function
|
||||||
* busy waiting and allows for an early return if it returns true
|
* which gets called while busy waiting and allows for an early return if it returns true
|
||||||
*/
|
*/
|
||||||
bool waitfor(uint32_t us, checker_func condition)
|
bool waitfor(uint32_t us, checker_func condition)
|
||||||
{
|
{
|
||||||
@@ -65,5 +66,6 @@ bool waitfor(uint32_t us, checker_func condition)
|
|||||||
if ((res = (*condition)()))
|
if ((res = (*condition)()))
|
||||||
return res;
|
return res;
|
||||||
} while (MCF_SLT_SCNT(0) - target > 0);
|
} while (MCF_SLT_SCNT(0) - target > 0);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user