Enable Zephyr dynamic stack threads

Enable Zephyr dynamic stack posix threading, with stack pool of 4 and
stack size of 4096.

TG-553
pull/193/head
Niccolò Izzo 2023-07-28 18:09:10 +02:00 zatwierdzone przez Silvano Seva
rodzic 1f1d20e120
commit 0c27c9ce28
2 zmienionych plików z 14 dodań i 4 usunięć

Wyświetl plik

@ -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
}

Wyświetl plik

@ -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