1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 14:33:52 +01:00

cpu/atmega_common: Fixed atmega_exit_isr

A context switch at the end of the ISR should only occur, if requested.
This fixes this.
This commit is contained in:
Marian Buschsieweke 2019-11-27 01:39:33 +01:00
parent 574c7d52d9
commit 97f727349b
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -248,11 +248,12 @@ void thread_yield_higher(void)
void atmega_exit_isr(void)
{
atmega_in_isr = 0;
atmega_context_save();
sched_run();
atmega_context_restore();
__asm__ volatile ("reti");
if (sched_context_switch_request) {
atmega_context_save();
sched_run();
atmega_context_restore();
__asm__ volatile ("reti");
}
}
__attribute__((always_inline)) static inline void atmega_context_save(void)