Skip to content

Commit efeb5ec

Browse files
committed
Allow mail loop stack size to be set by compile time parameter.
1 parent e55f6b0 commit efeb5ec

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cores/esp32/main.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
#define ARDUINO_RUNNING_CORE 1
1111
#endif
1212

13+
#ifndef ARDUINO_LOOP_STACK_SIZE
14+
#ifndef CONFIG_ARDUINO_LOOP_STACK_SIZE
15+
#define ARDUINO_LOOP_STACK_SIZE 8192
16+
#else
17+
#define ARDUINO_LOOP_STACK_SIZE CONFIG_ARDUINO_LOOP_STACK_SIZE
18+
#endif
19+
#endif
20+
1321
void loopTask(void *pvParameters)
1422
{
1523
setup();
@@ -23,7 +31,7 @@ void loopTask(void *pvParameters)
2331
extern "C" void app_main()
2432
{
2533
initArduino();
26-
xTaskCreatePinnedToCore(loopTask, "loopTask", 12*1024, NULL, 1, NULL, ARDUINO_RUNNING_CORE);
34+
xTaskCreatePinnedToCore(loopTask, "loopTask", ARDUINO_LOOP_STACK_SIZE, NULL, 1, NULL, ARDUINO_RUNNING_CORE);
2735
}
2836

2937
#endif

0 commit comments

Comments
 (0)