Merge needed define.
[bertos.git] / drv / timer.c
index b25afba5cc53e75fb76777fa59f6f50f3afd6275..0e756dbb6cb01c435062380cbd60536d0e165520 100644 (file)
  */
 
 #include "timer.h"
-#include <cpu/cpu.h>
+
+#include <cpu/attr.h>
+#include <cpu/types.h>
+#include <cpu/irq.h>
+
 #include <cfg/os.h>
 #include <cfg/debug.h>
 #include <cfg/module.h>
@@ -70,6 +74,9 @@
 
 #if CONFIG_KERNEL
        #include <config_kern.h>
+       #if CONFIG_KERN_PREEMPTIVE
+               #include <hw/switch.h>
+       #endif
        #if CONFIG_KERN_SIGNALS
                #include <kern/signal.h> /* sig_wait(), sig_check() */
                #include <kern/proc.h>   /* proc_current() */
@@ -173,9 +180,9 @@ Timer *timer_abort(Timer *timer)
  */
 void timer_delayTicks(ticks_t delay)
 {
-#if defined(IRQ_GETSTATE)
+#if defined(IRQ_ENABLED)
        /* We shouldn't sleep with interrupts disabled */
-       ASSERT(IRQ_GETSTATE());
+       ASSERT(IRQ_ENABLED());
 #endif
 
 #if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS