Arduino-Scheduler
Portable Collaborative Multi-Tasking Scheduler for Arduino
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
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
42
Scheduler
.
start
(
BlinkTask::setup
,
BlinkTask::loop
);
43
Scheduler
.
start
(
ShellTask::setup
,
ShellTask::loop
);
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
Trace.h
loop
void loop()
Definition:
SchedulerDemoNamespaces.ino:50
ShellTask::loop
void loop()
Definition:
ShellTask.h:39
BlinkTask::setup
void setup()
Definition:
BlinkTask.h:33
ShellTask::setup
void setup()
Definition:
ShellTask.h:33
SchedulerClass::stack
static size_t stack()
Definition:
Scheduler.cpp:127
Scheduler
SchedulerClass Scheduler
Definition:
Scheduler.cpp:53
ShellTask.h
SchedulerClass::start
static bool start(func_t taskSetup, func_t taskLoop, size_t stackSize=DEFAULT_STACK_SIZE)
Definition:
Scheduler.cpp:76
BlinkTask::loop
void loop()
Definition:
BlinkTask.h:42
TRACE
#define TRACE(msg)
Definition:
Trace.h:25
Scheduler.h
setup
void setup()
Definition:
SchedulerDemoNamespaces.ino:35
BlinkTask.h
examples
SchedulerDemoNamespaces
SchedulerDemoNamespaces.ino
Generated on Thu Aug 31 2017 12:52:30 for Arduino-Scheduler by
1.8.11