Arduino-Scheduler
Portable Collaborative Multi-Tasking Scheduler for Arduino
SchedulerDemoNamespaces.ino
Go to the documentation of this file.
1 
24 #include <Scheduler.h>
25 
26 // Check for SparkFun SAMD21 Breakout
27 #if defined(ARDUINO_ARCH_SAMD) && (USB_PID == 0x8D21)
28 #define Serial SerialUSB
29 #endif
30 
31 #include "Trace.h"
32 #include "BlinkTask.h"
33 #include "ShellTask.h"
34 
35 void setup()
36 {
37  Serial.begin(57600);
38  while (!Serial);
39  Serial.println(F("SchedulerDemoNamespaces: started"));
40 
41  // Initiate tasks
44 
45  // Print stack size
46  TRACE("stack=");
47  Serial.println(Scheduler.stack());
48 }
49 
50 void loop()
51 {
52  // Main loop iteration count
53  static int i = 0;
54 
55  // Print main loop iterations
56  TRACE("i=");
57  Serial.println(i++);
58  delay(500);
59 }
60 
void loop()
void loop()
Definition: ShellTask.h:39
void setup()
Definition: BlinkTask.h:33
void setup()
Definition: ShellTask.h:33
static size_t stack()
Definition: Scheduler.cpp:127
SchedulerClass Scheduler
Definition: Scheduler.cpp:53
static bool start(func_t taskSetup, func_t taskLoop, size_t stackSize=DEFAULT_STACK_SIZE)
Definition: Scheduler.cpp:76
void loop()
Definition: BlinkTask.h:42
#define TRACE(msg)
Definition: Trace.h:25
void setup()