mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
cortexm_common: Clear PendSV request after idle sleep
The PendSV interrupt is used to request a scheduling operation. An interrupt during the idle sleep can re-request the PendSV interrupt, while the PendSV is still busy scheduling the next thread. This clears the request after sleep to prevent triggering an extra PendSV interrupt after the current PendSV handler finished.
This commit is contained in:
parent
e8a8d12d96
commit
0eb66a429f
@ -474,4 +474,5 @@ void sched_arch_idle(void)
|
||||
#endif
|
||||
irq_restore(state);
|
||||
NVIC_SetPriority(PendSV_IRQn, CPU_CORTEXM_PENDSV_IRQ_PRIO);
|
||||
SCB->ICSR = SCB_ICSR_PENDSVCLR_Msk;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user