aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports/RVCT
diff options
context:
space:
mode:
Diffstat (limited to 'os/ports/RVCT')
-rw-r--r--os/ports/RVCT/ARMCMx/chcore_v7m.c2
-rw-r--r--os/ports/RVCT/ARMCMx/chcore_v7m.h9
2 files changed, 10 insertions, 1 deletions
diff --git a/os/ports/RVCT/ARMCMx/chcore_v7m.c b/os/ports/RVCT/ARMCMx/chcore_v7m.c
index 90dcbf32e..fb11547c6 100644
--- a/os/ports/RVCT/ARMCMx/chcore_v7m.c
+++ b/os/ports/RVCT/ARMCMx/chcore_v7m.c
@@ -114,7 +114,7 @@ void _port_init(void) {
/* Initialization of the vector table and priority related settings.*/
SCB_VTOR = CORTEX_VTOR_INIT;
- SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0);
+ SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(CORTEX_PRIGROUP_INIT);
#if CORTEX_USE_FPU
{
diff --git a/os/ports/RVCT/ARMCMx/chcore_v7m.h b/os/ports/RVCT/ARMCMx/chcore_v7m.h
index 98bbb6358..c31bbcffe 100644
--- a/os/ports/RVCT/ARMCMx/chcore_v7m.h
+++ b/os/ports/RVCT/ARMCMx/chcore_v7m.h
@@ -132,6 +132,15 @@
#define CORTEX_VTOR_INIT 0x00000000
#endif
+/**
+ * @brief NVIC PRIGROUP initialization expression.
+ * @details The default assigns all available priority bits as preemption
+ * priority with no sub-priority.
+ */
+#if !defined(CORTEX_PRIGROUP_INIT) || defined(__DOXYGEN__)
+#define CORTEX_PRIGROUP_INIT (7 - CORTEX_PRIORITY_BITS)
+#endif
+
/*===========================================================================*/
/* Port derived parameters. */
/*===========================================================================*/