* 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
/*
* Sanity check for config parameters required by this module.
*/
-#if !defined(CONFIG_KERNEL) || ((CONFIG_KERNEL != 0) && CONFIG_KERNEL != 1)
- #error CONFIG_KERNEL must be set to either 0 or 1 in config.h
+#if !defined(CONFIG_KERN) || ((CONFIG_KERN != 0) && CONFIG_KERN != 1)
+ #error CONFIG_KERN must be set to either 0 or 1 in config.h
#endif
#if !defined(CONFIG_WATCHDOG) || ((CONFIG_WATCHDOG != 0) && CONFIG_WATCHDOG != 1)
#error CONFIG_WATCHDOG must be set to either 0 or 1 in config.h
#include <drv/wdt.h>
#endif
-#if CONFIG_KERNEL
- #if CONFIG_KERN_SIGNALS
- #include <kern/signal.h> /* sig_wait(), sig_check() */
- #include <kern/proc.h> /* proc_current() */
- #include <cfg/macros.h> /* BV() */
- #endif
+#if defined (CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
+ #include <kern/signal.h> /* sig_wait(), sig_check() */
+ #include <kern/proc.h> /* proc_current() */
+ #include <cfg/macros.h> /* BV() */
#endif
void timer_add(Timer *timer)
{
Timer *node;
- cpuflags_t flags;
+ cpu_flags_t flags;
/* Inserting timers twice causes mayhem. */
void timer_delayTicks(ticks_t delay)
{
/* We shouldn't sleep with interrupts disabled */
- ASSERT_IRQ_ENABLED();
+ IRQ_ASSERT_ENABLED();
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
Timer t;
*/
void timer_init(void)
{
- TIMER_STROBE_INIT;
+ #if CONFIG_KERN_IRQ
+ MOD_CHECK(irq);
+ #endif
-#if CONFIG_TIMER_EVENTS
- LIST_INIT(&timers_queue);
-#endif
+ #if CONFIG_TIMER_EVENTS
+ LIST_INIT(&timers_queue);
+ #endif
+
+ TIMER_STROBE_INIT;
_clock = 0;