• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Revision15133 (tree)
Time2021-11-25 16:03:57
Authorgdisirio

Log Message

Added static initializer for virtual timers in RT.

Change Summary

Incremental Difference

--- trunk/os/rt/include/chvt.h (revision 15132)
+++ trunk/os/rt/include/chvt.h (revision 15133)
@@ -61,6 +61,33 @@
6161 /* Module macros. */
6262 /*===========================================================================*/
6363
64+/**
65+ * @brief Data part of a static virtual timer initializer.
66+ * @details This macro should be used when statically initializing a virtual
67+ * timer that is part of a bigger structure.
68+ *
69+ */
70+#define __VIRTUAL_TIMER_DATA() { \
71+ .dlist = { \
72+ .next = NULL. \
73+ .prev = NULL \
74+ .delta = (sysinterval_t)0 \
75+ }, \
76+ .func = NULL, \
77+ .par = NULL, \
78+ .reload = (sysinterval_t)0 \
79+}
80+
81+/**
82+ * @brief Static virtual timer initializer.
83+ * @details Statically initialized virtual timers require no explicit
84+ * initialization using @p chVTObjectInit().
85+ *
86+ * @param[in] name the name of the virtual timer variable
87+ */
88+#define VIRTUAL_TIMER_DECL(name) \
89+ virtual_timer_t name = __VIRTUAL_TIMER_DATA()
90+
6491 /*===========================================================================*/
6592 /* External declarations. */
6693 /*===========================================================================*/
--- trunk/readme.txt (revision 15132)
+++ trunk/readme.txt (revision 15133)
@@ -74,6 +74,7 @@
7474 *****************************************************************************
7575
7676 *** Next ***
77+- NEW: Added static initializer for virtual timers in RT.
7778 - NEW: Added new function chHeapIntegrityCheck().
7879 - NEW: Added EFL driver implementation for STM32G4xx.
7980 - NEW: Function chCoreGetStatusX() changed to return a memory region object
Show on old repository browser