RTOS: Only set the SVC priority if uVisor is not present

uVisor requires the SVCall to have priority 0, while RTX allows it to be
the second lowest priority level in the system (after PendSV).

This commit makes sure that the SVCall priority is not changed if uVisor
is present. The PendSV priority is not affected.
pull/2053/head
Alessandro Angelino 2016-06-28 18:52:11 +01:00
parent ec1ec7c3e2
commit e22280e684
1 changed files with 4 additions and 0 deletions

View File

@ -255,7 +255,11 @@ __inline static void rt_svc_init (void) {
if (prigroup >= sh) { if (prigroup >= sh) {
sh = prigroup + 1U; sh = prigroup + 1U;
} }
/* Only change the SVCall priority if uVisor is not present. */
#if !(defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED))
NVIC_SYS_PRI2 = ((0xFEFFFFFFU << sh) & 0xFF000000U) | (NVIC_SYS_PRI2 & 0x00FFFFFFU); NVIC_SYS_PRI2 = ((0xFEFFFFFFU << sh) & 0xFF000000U) | (NVIC_SYS_PRI2 & 0x00FFFFFFU);
#endif /* !(defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED)) */
#endif #endif
} }