fixed (hopefully) SD-card busy-wait loops

This commit is contained in:
Markus Fröschle
2013-07-14 17:36:46 +00:00
parent 5ffcf77588
commit 0af49237fc
6 changed files with 128 additions and 103 deletions

View File

@@ -39,7 +39,7 @@ extern __inline__ bool waitfor(uint32_t us, checker_func condition) __attribute_
*/
extern __inline__ void wait(uint32_t us)
{
uint32_t target = MCF_SLT_SCNT(0) - (us * 132);
int32_t target = MCF_SLT_SCNT(0) - (us * 132);
while (MCF_SLT_SCNT(0) > target);
}
@@ -50,7 +50,7 @@ extern __inline__ void wait(uint32_t us)
*/
extern __inline__ bool waitfor(uint32_t us, checker_func condition)
{
uint32_t target = MCF_SLT_SCNT(0) - (us * 132);
int32_t target = MCF_SLT_SCNT(0) - (us * 132);
uint32_t res;
do