cpu/atmega_common: increase stack size with xtimer

If a timer triggers while the idle thread is running, previously a stack
overflow was triggered. This commit increases the idle threads stack size if
xtimer is used.
This commit is contained in:
Marian Buschsieweke 2020-07-27 09:42:07 +02:00
parent 42eb044ec6
commit 040bad0425
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -49,8 +49,16 @@ extern "C" {
* to avoid not printing of debug in interrupts * to avoid not printing of debug in interrupts
*/ */
#ifndef THREAD_STACKSIZE_IDLE #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) #define THREAD_STACKSIZE_IDLE (128)
#endif #endif
#endif
/** @} */ /** @} */
/** /**