diff options
Diffstat (limited to 'os/hal/templates')
-rw-r--r-- | os/hal/templates/osal/osal.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/os/hal/templates/osal/osal.h b/os/hal/templates/osal/osal.h index f31501b79..1eb9ec5de 100644 --- a/os/hal/templates/osal/osal.h +++ b/os/hal/templates/osal/osal.h @@ -96,6 +96,21 @@ #define OSAL_ST_MODE OSAL_ST_MODE_PERIODIC
/** @} */
+/**
+ * @name IRQ-related constants
+ * @{
+ */
+/**
+ * @brief Total priority levels.
+ */
+#define OSAL_IRQ_PRIORITY_LEVELS 16U
+
+/**
+ * @brief Highest IRQ priority for HAL drivers.
+ */
+#define OSAL_IRQ_MAXIMUM_PRIORITY 0U
+/** @} */
+
/*===========================================================================*/
/* Module pre-compile time settings. */
/*===========================================================================*/
@@ -273,6 +288,12 @@ typedef struct { * @{
*/
/**
+ * @brief Priority level verification macro.
+ */
+#define OSAL_IRQ_IS_VALID_PRIORITY(n) \
+ (((n) >= OSAL_IRQ_MAXIMUM_PRIORITY) && ((n) < OSAL_IRQ_PRIORITY_LEVELS))
+
+/**
* @brief IRQ prologue code.
* @details This macro must be inserted at the start of all IRQ handlers.
*/
|