-
-
Notifications
You must be signed in to change notification settings - Fork 276
Home
Big Thank you for Doanh Văn Lương (aka tarzan115) for creating this wiki based on my documentation!
I always wanted to do it, and always did not find the time.
This unsolicited help is greatly appreciated!
Cooperative multitasking for Arduino microcontrollers
Version 2.2.1: 2016-12-20
A lightweight implementation of cooperative multitasking (task scheduling) supporting:
- Periodic task execution, with dynamic execution period in
milliseconds(default) ormicroseconds(if explicitly enabled) – frequency of execution - Number of iterations (limited or infinite number of iterations)
- Execution of tasks in predefined sequence
- Dynamic change of task execution parameters (frequency, number of iterations, callback methods)
- Power saving via entering IDLE sleep mode when tasks are not scheduled to run
- Support for event-driven task invocation via Status Request object
- Support for task IDs and Control Points for error handling and watchdog timer
- Support for Local Task Storage pointer (allowing use of same callback code for multiple tasks)
- Support for layered task prioritization
- Support for
std::functions(ESP8266only)
Scheduling overhead: between 15 and 18 microseconds per scheduling pass (Arduino UNO rev 3 @ 16MHz clock, single scheduler w/o prioritization)
TaskScheduler was tested on the following platforms:
- Arduino Uno R3
- Arduino Nano
- Arduino Micro
- ATtiny85
- ESP8266 (Node MCU v2.0)
-
Implementation scenarios and ideas
1. Event driven programming
2. "Native" support for finite state machine
3. Multiple possible callbacks for task
4. Interrup-driven execution support
5. UsingonEnableandonDisablemethods
6. Using status request objects
7. Using local task storage pointer
8. Enabling task prioritization -
Futher information
Please refer to examples, provided withTaskSchedulerpackage for further information and implementation options.Real time examples of
TaskSchedulerare available here: