Download the file
  1. #include "scheduler.h"
  2. #include <Arduino.h>
  3.  
  4. void TaskScheduler::run() {
  5. for(;;) {
  6. uint32_t now = millis();
  7. for (int t = 0; t < numTasks; t++) {
  8. Task *tp = tasks[t];
  9. if (tp->canRun(now)) {
  10. tp->run(now);
  11. break;
  12. }
  13. }
  14. }
  15. }
  16.  
  17. // vim:ft=arduino
  18.