Skip to content

Commit e22280e

Browse files
committed
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.
1 parent ec1ec7c commit e22280e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rtos/rtx/TARGET_CORTEX_M/rt_HAL_CM.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,11 @@ __inline static void rt_svc_init (void) {
255255
if (prigroup >= sh) {
256256
sh = prigroup + 1U;
257257
}
258+
259+
/* Only change the SVCall priority if uVisor is not present. */
260+
#if !(defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED))
258261
NVIC_SYS_PRI2 = ((0xFEFFFFFFU << sh) & 0xFF000000U) | (NVIC_SYS_PRI2 & 0x00FFFFFFU);
262+
#endif /* !(defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED)) */
259263
#endif
260264
}
261265

0 commit comments

Comments
 (0)