Skip to content

Commit b3c3a31

Browse files
committed
feat(udp): Allow to change the async_udp task stack size
Example: `-D CONFIG_ARDUINO_UDP_TASK_STACK_SIZE=2048` The default is to much conservative since a correctly developed app probably won't allocate too much on stack on the callbacks. I currently see a wast of memory: `I (1222501) MONITOR: async_udp (p=3) 3416 bytes`
1 parent 5521e02 commit b3c3a31

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Kconfig.projbuild

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ config ARDUINO_UDP_TASK_PRIORITY
147147
help
148148
Select at what priority you want the UDP task to run.
149149

150+
config ARDUINO_UDP_TASK_STACK_SIZE
151+
int "UDP task stack size"
152+
default 4096
153+
help
154+
Amount of stack available for the UDP task.
155+
150156
config ARDUINO_ISR_IRAM
151157
bool "Run interrupts in IRAM"
152158
default "n"

libraries/AsyncUDP/src/AsyncUDP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static bool _udp_task_start() {
189189
}
190190
if (!_udp_task_handle) {
191191
xTaskCreateUniversal(
192-
_udp_task, "async_udp", 4096, NULL, CONFIG_ARDUINO_UDP_TASK_PRIORITY, (TaskHandle_t *)&_udp_task_handle, CONFIG_ARDUINO_UDP_RUNNING_CORE
192+
_udp_task, "async_udp", CONFIG_ARDUINO_UDP_TASK_STACK_SIZE, NULL, CONFIG_ARDUINO_UDP_TASK_PRIORITY, (TaskHandle_t *)&_udp_task_handle, CONFIG_ARDUINO_UDP_RUNNING_CORE
193193
);
194194
if (!_udp_task_handle) {
195195
return false;

0 commit comments

Comments
 (0)