Use int numbers; fix some min and max values.
[bertos.git] / bertos / drv / timer.c
index bd0ff9daed9ec26bfe5ae35ff5266917b72329b1..694b37eea2b34c0b451b9317c25f9f878ce0a850 100644 (file)
@@ -40,7 +40,8 @@
 
 #include "cfg/cfg_timer.h"
 #include "cfg/cfg_wdt.h"
-#include "cfg/cfg_kern.h"
+#include "cfg/cfg_proc.h"
+#include "cfg/cfg_signal.h"
 #include <cfg/os.h>
 #include <cfg/debug.h>
 #include <cfg/module.h>
@@ -48,6 +49,7 @@
 #include <cpu/attr.h>
 #include <cpu/types.h>
 #include <cpu/irq.h>
+#include <cpu/power.h> // cpu_relax()
 
 /*
  * Include platform-specific binding code if we're hosted.
@@ -56,8 +58,6 @@
 #if OS_HOSTED
        //#include OS_CSOURCE(timer)
        #include <emul/timer_posix.c>
-#else
-       #include CPU_CSOURCE(timer)
 #endif
 
 /*
@@ -197,11 +197,7 @@ void timer_delayTicks(ticks_t delay)
 
        /* Busy wait */
        while (timer_clock() - start < delay)
-       {
-#if CONFIG_WATCHDOG
-               wdt_reset();
-#endif
-       }
+               cpu_relax();
 
 #endif /* !CONFIG_KERN_SIGNALS */
 }