Skip to content

Commit adce86e

Browse files
galakAnas Nashif
authored andcommitted
arm: Add build time consistency check for irq priority defines
We need to make sure that __NVIC_PRIO_BITS & CONFIG_NUM_IRQ_PRIO_BITS are set to the same value. Add a simple build time check to ensure this is the case. This is to catch future cases of issues like ZEP-2243. This is a stop gap til we resolve ZEP-2262, which covers use of both __NVIC_PRIO_BITS & CONFIG_NUM_IRQ_PRIO_BITS. Signed-off-by: Kumar Gala <[email protected]>
1 parent 0a8ad73 commit adce86e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/arch/arm/cortex_m/cmsis.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ typedef enum {
124124
#define __Vendor_SysTickConfig 0 /* Default to standard SysTick */
125125
#endif /* __NVIC_PRIO_BITS */
126126

127+
#if __NVIC_PRIO_BITS != CONFIG_NUM_IRQ_PRIO_BITS
128+
#error "CONFIG_NUM_IRQ_PRIO_BITS and __NVIC_PRIO_BITS are not set to the same value"
129+
#endif
130+
127131
#if defined(CONFIG_CPU_CORTEX_M0)
128132
#include <core_cm0.h>
129133
#elif defined(CONFIG_CPU_CORTEX_M0PLUS)

0 commit comments

Comments
 (0)