From 5545af44e767be172b159cf63f5f415fd4cd3e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Tue, 11 Dec 2012 09:02:42 +0000 Subject: [PATCH] additionally forced inlining by __attribute__((always_inline)) --- SD_CARD/BaS_gcc/include/wait.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SD_CARD/BaS_gcc/include/wait.h b/SD_CARD/BaS_gcc/include/wait.h index ba8c81b..ca7ec9f 100644 --- a/SD_CARD/BaS_gcc/include/wait.h +++ b/SD_CARD/BaS_gcc/include/wait.h @@ -29,6 +29,10 @@ #include +typedef uint32_t (*checker_func)(void); + +extern __inline__ void wait(uint32_t) __attribute__((always_inline)); +extern __inline__ uint32_t waitfor(uint32_t us, checker_func condition) __attribute__((always_inline)); /* * 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. @@ -44,7 +48,7 @@ extern __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 */ -extern __inline__ uint32_t waitfor(uint32_t us, uint32_t (*condition)(void)) +extern __inline__ uint32_t waitfor(uint32_t us, checker_func condition) { uint32_t target = MCF_SLT_SCNT(0) - (us * 132); uint32_t res;