projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move TIMER_AFTER() and TIMER_BEFORE() macros in drv/timer.h
[bertos.git]
/
bertos
/
drv
/
timer.h
diff --git
a/bertos/drv/timer.h
b/bertos/drv/timer.h
index de2680093243d1b47d0ec5884b3c56c94cea13db..a68ee5b21dd9703735582fdad4c701ea7f10ec69 100644
(file)
--- a/
bertos/drv/timer.h
+++ b/
bertos/drv/timer.h
@@
-30,6
+30,10
@@
* Copyright 2000, 2008 Bernie Innocenti <bernie@codewiz.org>
* -->
*
* Copyright 2000, 2008 Bernie Innocenti <bernie@codewiz.org>
* -->
*
+ * \defgroup drv_timers Timer module
+ * \ingroup core
+ * \{
+ *
* \brief Hardware independent timer driver.
*
* All timer related functions are implemented in this module. You have several options to use timers:
* \brief Hardware independent timer driver.
*
* All timer related functions are implemented in this module. You have several options to use timers:
@@
-41,7
+45,6
@@
* Whenever a timer expires you need to explicitly arm it again with timer_add(). If you want to abort a timer, use timer_abort().
* You can use conversion macros when using msecs to specify the delay.
*
* Whenever a timer expires you need to explicitly arm it again with timer_add(). If you want to abort a timer, use timer_abort().
* You can use conversion macros when using msecs to specify the delay.
*
- * \version $Id$
* \author Bernie Innocenti <bernie@codewiz.org>
*
* $WIZ$ module_name = "timer"
* \author Bernie Innocenti <bernie@codewiz.org>
*
* $WIZ$ module_name = "timer"
@@
-97,6
+100,9
@@
STATIC_ASSERT(sizeof(hptime_t) == SIZEOF_HPTIME_T);
extern volatile ticks_t _clock;
extern volatile ticks_t _clock;
+#define TIMER_AFTER(x, y) ((long)(y) - (long)(x) < 0)
+#define TIMER_BEFORE(x, y) TIMER_AFTER(y, x)
+
/**
* \brief Return the system tick counter (expressed in ticks)
*
/**
* \brief Return the system tick counter (expressed in ticks)
*
@@
-146,6
+152,7
@@
INLINE ticks_t timer_clock_unlocked(void)
return _clock;
}
return _clock;
}
+
/** Convert \a ms [ms] to ticks. */
INLINE ticks_t ms_to_ticks(mtime_t ms)
{
/** Convert \a ms [ms] to ticks. */
INLINE ticks_t ms_to_ticks(mtime_t ms)
{
@@
-313,4
+320,6
@@
INLINE void timer_setSignal(Timer *timer, struct Process *proc, sigmask_t sigs)
#endif /* CONFIG_KERN_SIGNALS */
#endif /* CONFIG_KERN_SIGNALS */
+/** \} */ //defgroup drv_timers
+
#endif /* DRV_TIMER_H */
#endif /* DRV_TIMER_H */