From 8e90ffa2ab4efa2cc35943ee2ea2978625c9ecab Mon Sep 17 00:00:00 2001 From: chrysn Date: Mon, 27 Feb 2012 19:20:19 +0100 Subject: fixed a bug in efm32 miniblink example actually, it wasn't a bug; the compiler just optimized a statement away until it was declared volatile. inserting a no-op assembler instruction to make it more obvious what's going on --- examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/miniblink.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/miniblink.c') diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/miniblink.c b/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/miniblink.c index 0941add..1976080 100644 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/miniblink.c +++ b/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/miniblink.c @@ -35,13 +35,12 @@ void led_toggle(void); int main(void) { - // FIXME: As of now, this doesn't work without x being volatile; an issue with linking? - volatile int x; + int x; led_setup(); while(1) { - for(x = 0; x < 200000; ++x); + for(x = 0; x < 200000; ++x) asm("mov r0,r0"); /* no-op, prevent compiler from optimizing this away */ led_toggle(); }; } -- cgit v1.2.3