diff --git a/Kconfig.projbuild b/Kconfig.projbuild index 17749264..0919dc7a 100644 --- a/Kconfig.projbuild +++ b/Kconfig.projbuild @@ -27,4 +27,10 @@ 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_EVENT_QUEUE_SIZE + int "Event queue size" + default 32 + help + Set the event queue size. Increasing this value may fix WDT triggers with larger transfers. + endmenu diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 89ff6ee3..ef098206 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_EVENT_QUEUE_SIZE, sizeof(lwip_event_packet_t *)); if(!_async_queue){ return false; } diff --git a/src/AsyncTCP.h b/src/AsyncTCP.h index ac87deda..a90aa60b 100644 --- a/src/AsyncTCP.h +++ b/src/AsyncTCP.h @@ -36,6 +36,10 @@ extern "C" { #define CONFIG_ASYNC_TCP_USE_WDT 1 //if enabled, adds between 33us and 200us per event #endif +#ifndef CONFIG_ASYNC_TCP_EVENT_QUEUE_SIZE +#define CONFIG_ASYNC_TCP_EVENT_QUEUE_SIZE 32 +#endif + class AsyncClient; #define ASYNC_MAX_ACK_TIME 5000