declared wait()-routines as inline void volatile since gcc decided to optimize out them sometimes. Do we need __attribute__(always_inline) ?
This commit is contained in:
@@ -19,8 +19,8 @@ extern void sd_card_idle();
|
||||
extern int sd_card_init();
|
||||
|
||||
/* wait...() routines moved to sysinit.c */
|
||||
extern inline void wait(uint32_t us);
|
||||
extern inline bool waitfor(uint32_t us,int (*condition)(void));
|
||||
extern inline void wait(volatile uint32_t us);
|
||||
extern inline volatile bool waitfor(volatile uint32_t us,int (*condition)(void));
|
||||
|
||||
/* Symbols from the linker script */
|
||||
extern uint8_t _STRAM_END[];
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <MCF5475.h>
|
||||
#include "bas_printf.h"
|
||||
|
||||
extern void wait(uint32_t value);
|
||||
extern void wait(volatile uint32_t value);
|
||||
|
||||
#ifdef _NOT_USED_ /* disabled assembler routines */
|
||||
|
||||
void sd_card_idle(void)
|
||||
{
|
||||
@@ -37,6 +39,7 @@ int sd_card_init(void)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* _NOT_USED_ */
|
||||
|
||||
uint32_t sd_com(uint32_t command)
|
||||
{
|
||||
@@ -51,7 +54,7 @@ uint32_t sd_com(uint32_t command)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void sd_init(void)
|
||||
void sd_card_init(void)
|
||||
{
|
||||
uint32_t ret;
|
||||
int i;
|
||||
@@ -89,7 +92,6 @@ void sd_init(void)
|
||||
wait(10000);
|
||||
|
||||
MCF_DSPI_DMCR = 0x800d3c00;
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
ret = sd_com(0x082000ff);
|
||||
@@ -107,8 +109,14 @@ void sd_init(void)
|
||||
ret = sd_com(0x082000ff);
|
||||
}
|
||||
|
||||
MCF_DSPI_DMCR = 0x800d3c00;
|
||||
|
||||
wait(10000);
|
||||
|
||||
xprintf("finished\r\n");
|
||||
}
|
||||
|
||||
void sd_card_idle(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ extern volatile long _VRAM; /* start address of video ram from linker script */
|
||||
* 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)
|
||||
inline volatile void wait(uint32_t us)
|
||||
{
|
||||
uint32_t target = MCF_SLT_SCNT(0) - (us * 132);
|
||||
|
||||
@@ -37,7 +37,7 @@ inline void wait(uint32_t us)
|
||||
* 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))
|
||||
inline volatile bool waitfor(volatile uint32_t us, int (*condition)(void))
|
||||
{
|
||||
uint32_t target = MCF_SLT_SCNT(0) - (us * 132);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user