Skip to content

Commit f04904c

Browse files
committed
CM3: Make ACTLR bit definitions conditional
The ACTLR register itself is conditional on chip revision, but its bit definitions were always defined. Make the the bit definitions also conditional, so it is possible to produce portable code that sets DISDEFWBUF if available: #ifdef SCnSCB_ACTLR_DISDEFWBUF_Msk SCnSCB->ACTLR |= SCnSCB_ACTLR_DISDEFWBUF_Msk; #endif (cherry-picked from CMSIS b2b04dbeece0a046556bfc320bef6b20bef3f16f)
1 parent 27e1bc3 commit f04904c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmsis/TARGET_CORTEX_M/core_cm3.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ typedef struct
668668
#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */
669669

670670
/* Auxiliary Control Register Definitions */
671-
671+
#if defined (__CM3_REV) && (__CM3_REV >= 0x200U)
672672
#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */
673673
#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */
674674

@@ -677,6 +677,7 @@ typedef struct
677677

678678
#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */
679679
#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */
680+
#endif
680681

681682
/*@} end of group CMSIS_SCnotSCB */
682683

0 commit comments

Comments
 (0)