Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit a53168f

Browse files
author
Adrian
committed
Allow setting queue and stack size via user defines
1 parent ca8ac5f commit a53168f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/AsyncTCP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static uint32_t _closed_index = []() {
9595

9696
static inline bool _init_async_event_queue(){
9797
if(!_async_queue){
98-
_async_queue = xQueueCreate(32, sizeof(lwip_event_packet_t *));
98+
_async_queue = xQueueCreate(CONFIG_ASYNC_TCP_QUEUE_SIZE, sizeof(lwip_event_packet_t *));
9999
if(!_async_queue){
100100
return false;
101101
}
@@ -218,7 +218,7 @@ static bool _start_async_task(){
218218
return false;
219219
}
220220
if(!_async_service_task_handle){
221-
xTaskCreateUniversal(_async_service_task, "async_tcp", 8192 * 2, NULL, 3, &_async_service_task_handle, CONFIG_ASYNC_TCP_RUNNING_CORE);
221+
xTaskCreateUniversal(_async_service_task, "async_tcp", CONFIG_ASYNC_TCP_STACK, NULL, 3, &_async_service_task_handle, CONFIG_ASYNC_TCP_RUNNING_CORE);
222222
if(!_async_service_task_handle){
223223
return false;
224224
}

src/AsyncTCP.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ extern "C" {
3535
#define CONFIG_ASYNC_TCP_RUNNING_CORE -1 //any available core
3636
#define CONFIG_ASYNC_TCP_USE_WDT 1 //if enabled, adds between 33us and 200us per event
3737
#endif
38+
#ifndef CONFIG_ASYNC_TCP_STACK
39+
#define CONFIG_ASYNC_TCP_STACK 8192 * 2
40+
#endif
41+
#ifndef CONFIG_ASYNC_TCP_QUEUE_SIZE
42+
#define CONFIG_ASYNC_TCP_QUEUE_SIZE 32
43+
#endif
3844

3945
class AsyncClient;
4046

0 commit comments

Comments
 (0)