Skip to content

Commit 301f93d

Browse files
committed
Adds support to change LoopTask Stack size
1 parent 7ce004e commit 301f93d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cores/esp32/Arduino.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ uint16_t makeWord(uint8_t h, uint8_t l);
180180
#define word(...) makeWord(__VA_ARGS__)
181181

182182
size_t getArduinoLoopTaskStackSize(void);
183-
#define SET_LOOPTASK_STACK_SIZE(sz) size_t getArduinoLoopTaskStackSize() { return sz;}
183+
#define SET_LOOP_TASK_STACK_SIZE(sz) size_t getArduinoLoopTaskStackSize() { return sz;}
184184

185185
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
186186
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);

libraries/ESP32/examples/ArduinoStackSize/ArduinoStackSize.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
This should be plenty for most general sketches.
77
88
There is a way to change the stack size of this task by using
9-
SET_LOOPTASK_STACK_SIZE(size);
9+
SET_LOOP_TASK_STACK_SIZE(size);
1010
It will bypass the default stack size of 8KB and allow the user to define a new size.
1111
1212
It is recommend this value to be higher than 8KB, for instance 16KB.
1313
This increasing may be necessary for the sketches that use deep recursion for instance.
1414
15-
In this example, you can verify it by changing or just commenting out SET_LOOPTASK_STACK_SIZE();
15+
In this example, you can verify it by changing or just commenting out SET_LOOP_TASK_STACK_SIZE();
1616
*/
1717

1818
#define ARDUINO_TASK_STACK_SIZE (16*1024) // 16KB
1919

2020
// This sets Arduino Stack Size - comment this line to use default 8K stack size
21-
SET_LOOPTASK_STACK_SIZE(ARDUINO_TASK_STACK_SIZE);
21+
SET_LOOP_TASK_STACK_SIZE(ARDUINO_TASK_STACK_SIZE);
2222

2323
void setup() {
2424
Serial.begin(115200);

0 commit comments

Comments
 (0)