From 0714013c6875744077ae6ddcec15f57cc1bc3538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Villac=C3=ADs=20Lasso?= Date: Thu, 28 Oct 2021 17:22:39 -0500 Subject: [PATCH] Allow setting stack size via user defines Based on https://github.com/me-no-dev/AsyncTCP/pull/89 . This is a trivial change and potentially useful. --- src/AsyncTCP.cpp | 2 +- src/AsyncTCP.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index f083995..a26b916 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -63,7 +63,7 @@ static bool _start_asyncsock_task(void) xTaskCreateUniversal( _asynctcpsock_task, "asyncTcpSock", - 8192 * 2, + CONFIG_ASYNC_TCP_STACK, NULL, 3, // <-- TODO: make priority a compile-time parameter &_asyncsock_service_task_handle, diff --git a/src/AsyncTCP.h b/src/AsyncTCP.h index b6fa6fa..6458d2f 100644 --- a/src/AsyncTCP.h +++ b/src/AsyncTCP.h @@ -44,6 +44,9 @@ 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 16384 // 8192 * 2 +#endif class AsyncClient;