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:
Markus Fröschle
2012-11-18 10:10:38 +00:00
parent 3101237277
commit 0b5e4aca81
3 changed files with 15 additions and 7 deletions

View File

@@ -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);