Disable timer_minutes() for targets with 16bit time_t.
[bertos.git] / drv / timer.h
index 924ee26c415a833343a26937add0e81cab920ec0..bb8c89dda02c34ce168e6cc7bbb937752528236e 100755 (executable)
 
 /*#*
  *#* $Log$
+ *#* Revision 1.18  2004/11/16 23:09:52  bernie
+ *#* Disable timer_minutes() for targets with 16bit time_t.
+ *#*
+ *#* Revision 1.17  2004/11/16 22:37:14  bernie
+ *#* Replace IPTR with iptr_t.
+ *#*
  *#* Revision 1.16  2004/08/25 14:12:08  rasky
  *#* Aggiornato il comment block dei log RCS
  *#*
@@ -81,7 +87,7 @@ extern void timer_udelay(utime_t utime);
 
 #ifndef CONFIG_TIMER_DISABLE_EVENTS
 
-#ifdef CONFIG_KERNEL
+#if CONFIG_KERNEL
        #include <kern/event.h>
 #else
        #include <mware/event.h>
@@ -167,11 +173,6 @@ INLINE time_t timer_ticks(void)
        return result;
 }
 
-DEPRECATED INLINE time_t timer_gettick(void)
-{
-       return timer_ticks();
-}
-
 
 /*!
  * Faster version of timer_ticks(), to be called only when the timer
@@ -185,11 +186,12 @@ INLINE time_t timer_ticks_unlocked(void)
        return _clock;
 }
 
-DEPRECATED INLINE time_t timer_gettick_irq(void)
-{
-       return timer_ticks_unlocked();
-}
 
+/*
+ * timer_minutes() makes no sense when time_t is 16bit because
+ * it overflows every 65.536 seconds.
+ */
+#if SIZEOF_TIME_T >= 4
 
 /*!
  * Return the minutes passed since timer start.
@@ -203,5 +205,7 @@ INLINE time_t timer_minutes(void)
        return timer_ticks() / (TICKS_PER_SEC * 60);
 }
 
+#endif /* SIZEOF_TIME_T >= 4 */
+
 #endif /* DRV_TIMER_H */