From 0a268ebfc38378978b30cda8dbbc4a93049cd836 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Wed, 27 Jul 2011 00:11:30 +0200 Subject: [PATCH] Fix #define to somethin which works :) --- firmware/basic/idle.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/firmware/basic/idle.c b/firmware/basic/idle.c index f59bd73..a2d4321 100644 --- a/firmware/basic/idle.c +++ b/firmware/basic/idle.c @@ -4,9 +4,10 @@ #include "lcd/print.h" QUEUE the_queue; -#ifdef ARM +#ifdef __arm__ volatile uint32_t _timectr=0; #else +#error "foo" extern uint32_t simTimeCounter(); #define _timectr (simTimeCounter()) #endif @@ -18,8 +19,10 @@ void work_queue(void){ int start; if (the_queue.qstart == the_queue.qend){ -#ifdef ARM +#ifdef __arm__ __asm volatile ("WFI"); +#else + delayms(10); #endif return; }; @@ -36,8 +39,10 @@ void delayms_queue(uint32_t ms){ int end=_timectr+ms/10; do { if (the_queue.qstart == the_queue.qend){ -#ifdef ARM +#ifdef __arm__ __asm volatile ("WFI"); +#else + delayms(10); #endif }else{ work_queue(); @@ -48,8 +53,10 @@ void delayms_queue(uint32_t ms){ void delayms_power(uint32_t ms){ ms+=_timectr; do { -#ifdef ARM +#ifdef __arm__ __asm volatile ("WFI"); +#else + delayms(10); #endif } while (ms >_timectr); };