diff --git a/Kconfig.projbuild b/Kconfig.projbuild index 17749264..82c9131c 100644 --- a/Kconfig.projbuild +++ b/Kconfig.projbuild @@ -27,4 +27,12 @@ config ASYNC_TCP_USE_WDT help Enable WDT for the AsyncTCP task, so it will trigger if a handler is locking the thread. +config ASYNC_TCP_STACK + int "Stack size for the AsyncTCP task" + default 16384 + +config ASYNC_TCP_QUEUE_SIZE + int "Events queue size" + default 32 + endmenu diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 89ff6ee3..72ddfcfc 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -95,7 +95,7 @@ static uint32_t _closed_index = []() { static inline bool _init_async_event_queue(){ if(!_async_queue){ - _async_queue = xQueueCreate(32, sizeof(lwip_event_packet_t *)); + _async_queue = xQueueCreate(CONFIG_ASYNC_TCP_QUEUE_SIZE, sizeof(lwip_event_packet_t *)); if(!_async_queue){ return false; } @@ -218,7 +218,7 @@ static bool _start_async_task(){ return false; } if(!_async_service_task_handle){ - xTaskCreateUniversal(_async_service_task, "async_tcp", 8192 * 2, NULL, 3, &_async_service_task_handle, CONFIG_ASYNC_TCP_RUNNING_CORE); + xTaskCreateUniversal(_async_service_task, "async_tcp", CONFIG_ASYNC_TCP_STACK, NULL, 3, &_async_service_task_handle, CONFIG_ASYNC_TCP_RUNNING_CORE); if(!_async_service_task_handle){ return false; } diff --git a/src/AsyncTCP.h b/src/AsyncTCP.h index ac87deda..1ed9c5ea 100644 --- a/src/AsyncTCP.h +++ b/src/AsyncTCP.h @@ -35,6 +35,12 @@ extern "C" { #define CONFIG_ASYNC_TCP_RUNNING_CORE -1 //any available core #define CONFIG_ASYNC_TCP_USE_WDT 1 //if enabled, adds between 33us and 200us per event #endif +#ifndef CONFIG_ASYNC_TCP_STACK +#define CONFIG_ASYNC_TCP_STACK 8192 * 2 +#endif +#ifndef CONFIG_ASYNC_TCP_QUEUE_SIZE +#define CONFIG_ASYNC_TCP_QUEUE_SIZE 32 +#endif class AsyncClient;