Skip to content

Commit

Permalink
Allow setting queue and stack size via user defines
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian committed Apr 16, 2020
1 parent ca8ac5f commit a53168f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AsyncTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
6 changes: 6 additions & 0 deletions src/AsyncTCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a53168f

Please sign in to comment.