Skip to content

Commit 95a0f81

Browse files
committed
Align default stack size with arduino-libraries/Scheduler.
1 parent 6c15bab commit 95a0f81

File tree

4 files changed

+9
-31
lines changed

4 files changed

+9
-31
lines changed

README.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The tasks will start execution when the main task yields. The
1919
_taskSetup_ is called first and once by the task followed by repeated
2020
calls to _taskLoop_. This works just as the Arduino setup() and loop()
2121
functions. There is also an optional parameter, _taskStackSize_. The
22-
default value depends on the architecture (128 bytes for AVR and 512
22+
default value depends on the architecture (128 bytes for AVR and 1024
2323
bytes for SAM/SAMD/Teensy 3.X).
2424

2525
````
@@ -68,25 +68,3 @@ Sparkfun SAMD21 (48 MHz) | 2.60 | 125
6868
Arduino Due (84 MHz) | 1.36 | 115
6969
Teensy 3.1 (72 MHz) | 1.10 | 80
7070
Teensy 3.6 (180 MHz) | 0.43 | 78
71-
72-
### Max Tasks (default stack size)
73-
74-
Board | Tasks | Stack (bytes)
75-
------|-------|--------------
76-
Arduino Uno, Nano, Pro-Mini, etc (16 MHz) | 9 | 128
77-
Sparkfun SAMD21 (48 MHz) | 26 | 512
78-
Teensy 3.1 (72 MHz) | 26 | 512
79-
Teensy 3.6 (180 MHz) | 26 | 512
80-
Arduino Mega 2560 (16 MHz) | 48 | 128
81-
Arduino Due (84 MHz) | 52 | 512
82-
83-
### Memory Footprint
84-
85-
Board | PROGMEM | SRAM (bytes)
86-
------|---------|-------------
87-
Arduino Due (84 MHz) | 224 | NA
88-
Arduino Uno, Nano, Pro-Mini, etc (16 MHz) | 546 | 42
89-
Arduino Mega 2560 (16 MHz) | 548 | 44
90-
Sparkfun SAMD21 (48 MHz) | NA | NA
91-
Teensy 3.1 (72 MHz) | NA | NA
92-
Teensy 3.6 (180 MHz) | NA | NA

Scheduler.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @file Scheduler.h
3-
* @version 1.4
3+
* @version 1.5
44
*
55
* @section License
66
* Copyright (C) 2015-2017, Mikael Patel
@@ -104,7 +104,7 @@ class SchedulerClass {
104104

105105
#if defined(TEENSYDUINO)
106106
/** Default stack size and stack max. */
107-
static const size_t DEFAULT_STACK_SIZE = 512;
107+
static const size_t DEFAULT_STACK_SIZE = 1024;
108108
#if defined(__MK20DX256__)
109109
/** Teensy 3.2: 64 Kbyte. */
110110
static const size_t STACK_MAX = 16384;
@@ -124,12 +124,12 @@ class SchedulerClass {
124124

125125
#elif defined(ARDUINO_ARCH_SAM)
126126
/** Default stack size and stack max. */
127-
static const size_t DEFAULT_STACK_SIZE = 512;
127+
static const size_t DEFAULT_STACK_SIZE = 1024;
128128
static const size_t STACK_MAX = 32768;
129129

130130
#elif defined(ARDUINO_ARCH_SAMD)
131131
/** Default stack size and stack max. */
132-
static const size_t DEFAULT_STACK_SIZE = 512;
132+
static const size_t DEFAULT_STACK_SIZE = 1024;
133133
static const size_t STACK_MAX = 16384;
134134

135135
#else

examples/SchedulerBlinkMax/SchedulerBlinkMax.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @section Description
1919
* This Arduino sketch uses the Scheduler library.
20-
* Blink with max number of pins; 64 (128) bytes per task.
20+
* Blink with max number of pins; 64 (256) bytes per task.
2121
*
2222
* @section Output
2323
* IDE 1.8.1, Serial Monitor, Arduino Mega 2560
@@ -46,7 +46,7 @@
4646
#if defined(ARDUINO_ARCH_AVR)
4747
const size_t STACK_SIZE = 64;
4848
#else
49-
const size_t STACK_SIZE = 128;
49+
const size_t STACK_SIZE = 256;
5050
#endif
5151

5252
int next_pin = 2;

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name=Simple Scheduler
2-
version=1.2.4
1+
name=Portable Scheduler
2+
version=1.2.5
33
author=Mikael Patel
44
maintainer=Mikael Patel <mikael.patel@gmail.com>
55
sentence=Scheduler for simple multi-tasking.

0 commit comments

Comments
 (0)