* Try the CPU specific one for bare-metal environments.
*/
#if OS_HOSTED
- #include OS_CSOURCE(timer)
+ //#include OS_CSOURCE(timer)
+ #include <emul/timer_posix.c>
#else
#include CPU_CSOURCE(timer)
#endif
volatile ticks_t _clock;
-#ifndef CONFIG_TIMER_DISABLE_EVENTS
+#if CONFIG_TIMER_EVENTS
/**
* List of active asynchronous timers.
return timer;
}
-#endif /* CONFIG_TIMER_DISABLE_EVENTS */
+#endif /* CONFIG_TIMER_EVENTS */
/**
Timer t;
ASSERT(!sig_check(SIG_SINGLE));
- timer_set_event_signal(&t, proc_current(), SIG_SINGLE);
+ timer_setSignal(&t, proc_current(), SIG_SINGLE);
timer_setDelay(&t, delay);
timer_add(&t);
sig_wait(SIG_SINGLE);
}
-#ifndef CONFIG_TIMER_DISABLE_UDELAY
+#if CONFIG_TIMER_UDELAY
/**
* Busy wait until the specified amount of high-precision ticks have elapsed.
timer_busyWait(delay);
}
-#endif /* CONFIG_TIMER_DISABLE_UDELAY */
+#endif /* CONFIG_TIMER_UDELAY */
/**
#pragma interrupt saveall
#endif
-#ifndef CONFIG_TIMER_DISABLE_EVENTS
+#if CONFIG_TIMER_EVENTS
Timer *timer;
#endif
+
/*
* On systems sharing IRQ line and vector, this check is needed
* to ensure that IRQ is generated by timer source.
/* Update the master ms counter */
++_clock;
-#ifndef CONFIG_TIMER_DISABLE_EVENTS
+#if CONFIG_TIMER_EVENTS
/*
* Check the first timer request in the list and process
* it when it has expired. Repeat this check until the
/* Execute the associated event */
event_do(&timer->expire);
}
-#endif /* CONFIG_TIMER_DISABLE_EVENTS */
+#endif /* CONFIG_TIMER_EVENTS */
TIMER_STROBE_OFF;
}
*/
void timer_init(void)
{
- TIMER_STROBE_INIT;
+ #if CONFIG_KERN_IRQ
+ MOD_CHECK(irq);
+ #endif
-#ifndef CONFIG_TIMER_DISABLE_EVENTS
- LIST_INIT(&timers_queue);
-#endif
+ #if CONFIG_TIMER_EVENTS
+ LIST_INIT(&timers_queue);
+ #endif
+
+ TIMER_STROBE_INIT;
_clock = 0;