README 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. Task Scheduler – cooperative multitasking for Arduino microcontrollers
  2. Version 1.8.1: 2015-10-22
  3. OVERVIEW:
  4. A lightweight implementation of cooperative multitasking (task scheduling) supporting:
  5. 1. Periodic task execution (with dynamic execution period in milliseconds)
  6. 2. Number of iterations (n times)
  7. 3. Execution of tasks in predefined sequence
  8. 4. Dynamic change of task execution parameters (frequency, number of iterations, callback function)
  9. 5. Power saving via entering IDLE sleep mode between tasks are scheduled to run
  10. 6. Support for task invocation via Status Request object
  11. 7. Support for task IDs and Control Points for error handling and watchdog timer
  12. Changelog:
  13. v1.0.0:
  14. 2015-02-24 - Initial release
  15. 2015-02-28 - added delay() and disableOnLastIteration() functions
  16. 2015-03-25 - changed scheduler execute() function for a more precise delay calculation:
  17. 1. Do not delay if any of the tasks ran (making request for immediate execution redundant)
  18. 2. Delay is invoked only if none of the tasks ran
  19. 3. Delay is based on the min anticipated wait until next task _AND_ the runtime of execute function itself.
  20. 2015-05-11 - added restart() and restartDelayed() functions to restart tasks which are on hold after running all iterations
  21. 2015-05-19 - completely removed delay from the scheduler since there are no power saving there. using 1 ms sleep instead
  22. v1.4.1:
  23. 2015-09-15 - more careful placement of AVR-specific includes for sleep functions (compatibility with DUE)
  24. sleep on idle run is no longer a default and should be explicitly compiled with _TASK_SLEEP_ON_IDLE_RUN defined
  25. v1.5.0:
  26. 2015-09-20 - access to currently executing task (for callback functions)
  27. 2015-09-20 - pass scheduler as a parameter to the task constructor to append the task to the end of the chain
  28. 2015-09-20 - option to create a task already enabled
  29. v1.5.1:
  30. 2015-09-21 - bug fix: incorrect handling of active tasks via set() and setIterations().
  31. Thanks to Hannes Morgenstern for catching this one
  32. v1.6.0:
  33. 2015-09-22 - revert back to having all tasks disable on last iteration.
  34. 2015-09-22 - deprecated disableOnLastIteration method as a result
  35. 2015-10-01 - made version numbers semver compliant (documentation only)
  36. v1.7.0:
  37. 2015-10-08 - introduced callback run counter - callback functions can branch on the iteration number.
  38. 2015-10-11 - enableIfNot() - enable a task only if it is not already enabled. Returns true if was already enabled, false if was disabled.
  39. 2015-10-11 - disable() returns previous enable state (true if was enabled, false if was already disabled)
  40. 2015-10-11 - introduced callback functions "on enable" and "on disable". On enable runs every time enable is called, on disable runs only if task was enabled
  41. 2015-10-12 - new Task method: forceNextIteration() - makes next iteration happen immediately during the next pass regardless how much time is left
  42. v1.8.0:
  43. 2015-10-13 - support for status request objects allowing tasks waiting on requests
  44. 2015-10-13 - moved to a single header file to allow compilation control via #defines from the main sketch
  45. v1.8.1:
  46. 2015-10-22 - implement Task id and control points to support identification of failure points for watchdog timer logging