Make LOOP_STACK_SIZE user configurable at compile-time. (#5173)

This PR lets the user override the LOOP STACK SIZE set in sdkconfig (for example with -DARDUINO_LOOP_STACK_SIZE=12288).
This commit is contained in:
Clemens Kirchgatterer 2021-05-18 12:58:56 +02:00 committed by GitHub
parent 0d6b142228
commit 2082945d36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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