From 7b872ae805259173949183d6184411e586f53f6f Mon Sep 17 00:00:00 2001 From: Clemens Kirchgatterer Date: Wed, 12 May 2021 17:11:40 +0200 Subject: [PATCH] Make LOOP_STACK_SIZE user configurable at compile-time. This PR lets the user override the LOOP STACK SIZE set in sdkconfig (for example with -DARDUINO_LOOP_STACK_SIZE=12288). --- cores/esp32/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cores/esp32/main.cpp b/cores/esp32/main.cpp index 797ec483e12..c7ffb8bcb1a 100644 --- a/cores/esp32/main.cpp +++ b/cores/esp32/main.cpp @@ -6,8 +6,12 @@ #include "USB.h" #endif +#ifndef ARDUINO_LOOP_STACK_SIZE #ifndef CONFIG_ARDUINO_LOOP_STACK_SIZE -#define CONFIG_ARDUINO_LOOP_STACK_SIZE 8192 +#define ARDUINO_LOOP_STACK_SIZE 8192 +#else +#define ARDUINO_LOOP_STACK_SIZE CONFIG_ARDUINO_LOOP_STACK_SIZE +#endif #endif TaskHandle_t loopTaskHandle = NULL; @@ -48,7 +52,7 @@ extern "C" void app_main() #endif loopTaskWDTEnabled = false; initArduino(); - xTaskCreateUniversal(loopTask, "loopTask", CONFIG_ARDUINO_LOOP_STACK_SIZE, NULL, 1, &loopTaskHandle, ARDUINO_RUNNING_CORE); + xTaskCreateUniversal(loopTask, "loopTask", ARDUINO_LOOP_STACK_SIZE, NULL, 1, &loopTaskHandle, ARDUINO_RUNNING_CORE); } #endif