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.