aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include/chvt.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel/include/chvt.h')
-rw-r--r--os/kernel/include/chvt.h44
1 files changed, 27 insertions, 17 deletions
diff --git a/os/kernel/include/chvt.h b/os/kernel/include/chvt.h
index e75e966d5..0038e3d0a 100644
--- a/os/kernel/include/chvt.h
+++ b/os/kernel/include/chvt.h
@@ -30,25 +30,30 @@
#define _CHVT_H_
/**
- * @brief Time conversion utility.
+ * @name Time conversion utilities
+ * @{
+ */
+/**
+ * @brief Seconds to system ticks.
* @details Converts from seconds to system ticks number.
* @note The result is rounded upward to the next tick boundary.
*/
#define S2ST(sec) ((systime_t)((sec) * CH_FREQUENCY))
/**
- * @brief Time conversion utility.
+ * @brief Milliseconds t0 system ticks.
* @details Converts from milliseconds to system ticks number.
* @note The result is rounded upward to the next tick boundary.
*/
#define MS2ST(msec) ((systime_t)(((((msec) - 1L) * CH_FREQUENCY) / 1000L) + 1L))
/**
- * @brief Time conversion utility.
+ * @brief Microseconds to system ticks.
* @details Converts from microseconds to system ticks number.
* @note The result is rounded upward to the next tick boundary.
*/
#define US2ST(usec) ((systime_t)(((((usec) - 1L) * CH_FREQUENCY) / 1000000L) + 1L))
+/** @} */
/**
* @brief Virtual Timer callback function.
@@ -95,6 +100,10 @@ typedef struct {
extern VTList vtlist;
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
* @brief Virtual timers ticker.
*
* @iclass
@@ -115,20 +124,6 @@ extern VTList vtlist;
} \
}
-/*
- * Virtual Timers APIs.
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
- void _vt_init(void);
- void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par);
- void chVTResetI(VirtualTimer *vtp);
- bool_t chTimeIsWithin(systime_t start, systime_t end);
-#ifdef __cplusplus
-}
-#endif
-
/**
* @brief Returns TRUE if the speciified timer is armed.
*
@@ -148,6 +143,21 @@ extern "C" {
* @api
*/
#define chTimeNow() (vtlist.vt_systime)
+/** @} */
+
+/*
+ * Virtual Timers APIs.
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void _vt_init(void);
+ void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par);
+ void chVTResetI(VirtualTimer *vtp);
+ bool_t chTimeIsWithin(systime_t start, systime_t end);
+#ifdef __cplusplus
+}
+#endif
#endif /* _CHVT_H_ */