timer: check for initialization of irq module when it is enabled
[bertos.git] / bertos / drv / timer.c
index 485cc0229d2192796b6c2cfe2d1ae630654a9984..c0106d85bbe515a32747c977e1ced7e48016b5e8 100644 (file)
@@ -325,11 +325,15 @@ MOD_DEFINE(timer)
  */
 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;