diff --git a/cpu/atmega_common/include/cpu_conf.h b/cpu/atmega_common/include/cpu_conf.h index bd00d7e278..e97dd2fb0d 100644 --- a/cpu/atmega_common/include/cpu_conf.h +++ b/cpu/atmega_common/include/cpu_conf.h @@ -49,8 +49,16 @@ extern "C" { * to avoid not printing of debug in interrupts */ #ifndef THREAD_STACKSIZE_IDLE +#ifdef MODULE_XTIMER +/* xtimer's 64 bit arithmetic doesn't perform well on 8 bit archs. In order to + * prevent a stack overflow when an timer triggers while the idle thread is + * running, we have to increase the stack size then + */ +#define THREAD_STACKSIZE_IDLE (192) +#else #define THREAD_STACKSIZE_IDLE (128) #endif +#endif /** @} */ /**