1
0
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:
Koen Zandberg 2020-07-21 11:23:49 +02:00
parent e8a8d12d96
commit 0eb66a429f
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B

View File

@ -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;
}