From 7d5bf9e38547463452a52ad131a3f792324906ed Mon Sep 17 00:00:00 2001 From: coylen Date: Wed, 2 Dec 2020 09:52:04 +0000 Subject: [PATCH] [1.0.5] Make looptask stack size configurable (#4564) Added guarded define to set the stacksize on the main looptask. Advantage of this is that build_flags can be used to provide a different value for the stack size should it be neccessary default behaviour is unaffected --- cores/esp32/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cores/esp32/main.cpp b/cores/esp32/main.cpp index 41f1985b..e2a61c8e 100644 --- a/cores/esp32/main.cpp +++ b/cores/esp32/main.cpp @@ -3,6 +3,10 @@ #include "esp_task_wdt.h" #include "Arduino.h" +#ifndef CONFIG_ARDUINO_LOOP_STACK_SIZE +#define CONFIG_ARDUINO_LOOP_STACK_SIZE 8192 +#endif + TaskHandle_t loopTaskHandle = NULL; #if CONFIG_AUTOSTART_ARDUINO @@ -25,7 +29,7 @@ extern "C" void app_main() { loopTaskWDTEnabled = false; initArduino(); - xTaskCreateUniversal(loopTask, "loopTask", 8192, NULL, 1, &loopTaskHandle, CONFIG_ARDUINO_RUNNING_CORE); + xTaskCreateUniversal(loopTask, "loopTask", CONFIG_ARDUINO_LOOP_STACK_SIZE, NULL, 1, &loopTaskHandle, CONFIG_ARDUINO_RUNNING_CORE); } #endif