fixed a few compiler warnings
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <sd_card.h>
|
||||
#include <bas_printf.h>
|
||||
#include <sysinit.h>
|
||||
#include <wait.h>
|
||||
#include <MCF5475.h>
|
||||
|
||||
/*
|
||||
@@ -168,7 +169,6 @@ static void xmit_spi_multi(const uint8_t *buff, uint32_t btx)
|
||||
|
||||
static uint32_t card_ready(void)
|
||||
{
|
||||
static uint32_t counter = 0;
|
||||
uint8_t d;
|
||||
|
||||
d = xchg_spi(0xff);
|
||||
|
||||
@@ -29,30 +29,3 @@
|
||||
#include <MCF5475.h>
|
||||
|
||||
#include <wait.h>
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
inline void wait(uint32_t us)
|
||||
{
|
||||
uint32_t target = MCF_SLT_SCNT(0) - (us * 132);
|
||||
|
||||
while (MCF_SLT_SCNT(0) > target);
|
||||
}
|
||||
|
||||
/*
|
||||
* the same as above, with a checker function which gets called while
|
||||
* busy waiting and allows for an early return if it returns true
|
||||
*/
|
||||
inline bool waitfor(uint32_t us, int (*condition)(void))
|
||||
{
|
||||
uint32_t target = MCF_SLT_SCNT(0) - (us * 132);
|
||||
|
||||
do
|
||||
{
|
||||
if ((*condition)())
|
||||
return TRUE;
|
||||
} while (MCF_SLT_SCNT(0) > target);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user