From 2aadae694cf1ce0f3197d5208297ada3d01c0f28 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 3 Oct 2021 06:56:35 +0000 Subject: [PATCH] More clear code. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14861 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/common/ports/ARMv7-M-ALT/chcore.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/os/common/ports/ARMv7-M-ALT/chcore.h b/os/common/ports/ARMv7-M-ALT/chcore.h index 5bec255e8..ae933996a 100644 --- a/os/common/ports/ARMv7-M-ALT/chcore.h +++ b/os/common/ports/ARMv7-M-ALT/chcore.h @@ -361,6 +361,11 @@ */ #define CORTEX_MAX_KERNEL_PRIORITY (CORTEX_PRIORITY_SVCALL + 1) +/** + * @brief Minimum usable priority for normal ISRs. + */ +#define CORTEX_MIN_KERNEL_PRIORITY (CORTEX_PRIORITY_PENDSV - 1) + /** * @brief BASEPRI level within kernel lock. */ @@ -513,7 +518,7 @@ struct port_context { * @brief Priority level verification macro. */ #define PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) \ - (((n) >= CORTEX_MAX_KERNEL_PRIORITY) && ((n) < CORTEX_PRIORITY_LEVELS)) + (((n) >= CORTEX_MAX_KERNEL_PRIORITY) && ((n) <= CORTEX_MIN_KERNEL_PRIORITY)) /** * @brief Optimized thread function declaration macro.