Skip to content

Commit

Permalink
arm: Add build time consistency check for irq priority defines
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
galak authored and Anas Nashif committed Jun 9, 2017
1 parent 0a8ad73 commit adce86e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/arch/arm/cortex_m/cmsis.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ typedef enum {
#define __Vendor_SysTickConfig 0 /* Default to standard SysTick */
#endif /* __NVIC_PRIO_BITS */

#if __NVIC_PRIO_BITS != CONFIG_NUM_IRQ_PRIO_BITS
#error "CONFIG_NUM_IRQ_PRIO_BITS and __NVIC_PRIO_BITS are not set to the same value"
#endif

#if defined(CONFIG_CPU_CORTEX_M0)
#include <core_cm0.h>
#elif defined(CONFIG_CPU_CORTEX_M0PLUS)
Expand Down

0 comments on commit adce86e

Please sign in to comment.