From 112e378fccf13b091a7f761395d390b2eaabebde Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 9 Jan 2024 19:00:22 +0100 Subject: [PATCH] cpu/avr8_common: fix build with !core_thread --- cpu/avr8_common/thread_arch.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cpu/avr8_common/thread_arch.c b/cpu/avr8_common/thread_arch.c index 1806db364b..f6529c9fb4 100644 --- a/cpu/avr8_common/thread_arch.c +++ b/cpu/avr8_common/thread_arch.c @@ -260,6 +260,10 @@ void NORETURN avr8_enter_thread_mode(void) void thread_yield_higher(void) { + if (!IS_USED(MODULE_CORE_THREAD)) { + return; + } + if (irq_is_in() == 0) { avr8_context_save(); sched_run(); @@ -278,7 +282,8 @@ void avr8_exit_isr(void) __asm__ volatile ("" : : : "memory"); /* schedule should switch context when returning from a non nested interrupt */ - if (sched_context_switch_request && avr8_state_irq_count == 0) { + if (sched_context_switch_request && avr8_state_irq_count == 0 && + IS_USED(MODULE_CORE_THREAD)) { avr8_context_save(); sched_run(); avr8_context_restore();