diff --git a/openrtx/src/core/threads.c b/openrtx/src/core/threads.c index 1d433762..a757d9b0 100644 --- a/openrtx/src/core/threads.c +++ b/openrtx/src/core/threads.c @@ -189,13 +189,15 @@ void *rtx_threadFunc(void *arg) */ void create_threads() { + pthread_t rtx_thread; + pthread_t ui_thread; + // Create RTX state mutex pthread_mutex_init(&rtx_mutex, NULL); +#ifndef __ZEPHYR__ // Create rtx radio thread - pthread_t rtx_thread; pthread_attr_t rtx_attr; - pthread_attr_init(&rtx_attr); pthread_attr_setstacksize(&rtx_attr, RTX_TASK_STKSIZE); @@ -209,10 +211,13 @@ void create_threads() pthread_create(&rtx_thread, &rtx_attr, rtx_threadFunc, NULL); // Create UI thread - pthread_t ui_thread; pthread_attr_t ui_attr; - pthread_attr_init(&ui_attr); pthread_attr_setstacksize(&ui_attr, UI_TASK_STKSIZE); pthread_create(&ui_thread, &ui_attr, ui_threadFunc, NULL); +#else + // On zephyr just spawn the threads without setting the attributes + pthread_create(&rtx_thread, NULL, rtx_threadFunc, NULL); + pthread_create(&ui_thread, NULL, ui_threadFunc, NULL); +#endif } diff --git a/platform/targets/ttwrplus/ttwrplus_defconfig b/platform/targets/ttwrplus/ttwrplus_defconfig index a51f335a..5a2d2530 100644 --- a/platform/targets/ttwrplus/ttwrplus_defconfig +++ b/platform/targets/ttwrplus/ttwrplus_defconfig @@ -3,3 +3,8 @@ CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_DISPLAY=y CONFIG_SSD1306=y CONFIG_SSD1306_SH1106_COMPATIBLE=y +CONFIG_THREAD_STACK_INFO=y +CONFIG_DYNAMIC_THREAD=y +CONFIG_DYNAMIC_THREAD_STACK_SIZE=4096 +CONFIG_DYNAMIC_THREAD_PREFER_POOL=y +CONFIG_DYNAMIC_THREAD_POOL_SIZE=4