aboutsummaryrefslogtreecommitdiffstats
path: root/os/halnew/osal/chibios/osal.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/halnew/osal/chibios/osal.h')
-rw-r--r--os/halnew/osal/chibios/osal.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/os/halnew/osal/chibios/osal.h b/os/halnew/osal/chibios/osal.h
index 52509e8c8..9c6170d4b 100644
--- a/os/halnew/osal/chibios/osal.h
+++ b/os/halnew/osal/chibios/osal.h
@@ -74,6 +74,29 @@
/** @} */
#endif
+/**
+ * @name Systick modes.
+ * @{
+ */
+#define OSAL_ST_MODE_NONE 0
+#define OSAL_ST_MODE_PERIODIC 1
+#define OSAL_ST_MODE_FREERUNNING 2
+/** @} */
+
+/**
+ * @brief Systick mode required by the underlying OS.
+ */
+#if (CH_CFG_TIMEDELTA == 0) || defined(__DOXYGEN__)
+#define OSAL_ST_MODE OSAL_ST_MODE_PERIODIC
+#else
+#define OSAL_ST_MODE OSAL_ST_MODE_FREERUNNING
+#endif
+
+/**
+ * @brief Required systick frequency or resolution.
+ */
+#define OSAL_SYSTICK_FREQUENCY CH_CFG_FREQUENCY
+
/*===========================================================================*/
/* Module pre-compile time settings. */
/*===========================================================================*/
@@ -287,6 +310,18 @@ static inline void osalSysUnlockFromISR(void) {
}
/**
+ * @brief Systick callback for the underlying OS.
+ * @note This callback is only defined if the OSAL requires such a
+ * service from the HAL.
+ */
+#if (OSAL_ST_MODE != OSAL_ST_MODE_NONE) || defined(__DOXYGEN__)
+static inline void osalOsTimerHandlerI(void) {
+
+ chSysTimerHandlerI();
+}
+#endif
+
+/**
* @brief Checks if a reschedule is required and performs it.
* @note I-Class functions invoked from thread context must not reschedule
* by themselves, an explicit reschedule using this function is