diff --git a/TaskSched.cpp b/TaskSched.cpp index c90b69e..6ad09d4 100644 --- a/TaskSched.cpp +++ b/TaskSched.cpp @@ -235,7 +235,7 @@ void Task::runIt() { unsigned long Sched::getSize() { - return tTasks.size(); + return tTasks.get_size(); } /** num = true show status of num tasks, * @@ -248,7 +248,7 @@ String Sched::displayStatus(int num,String taskName,bool raw) { char temp[1000]; strcpy(temp,""); - std::list::iterator it; + SimpleList::iterator it; sprintf(printBuffer,"%s",""); int cnt=0; for (it = tTasks.begin(); it != tTasks.end(); ++it){ @@ -307,7 +307,7 @@ void Sched::addTask(Task *task) #ifdef DEBUG Serial.printf("add called for task, %s %x\n",task->getName().c_str(),task); #endif - tTasks.push_front(task); + tTasks.push_back(task); return; }; @@ -329,7 +329,7 @@ void Sched::run() #ifdef DEBUG // Serial.println("Looking for tasks"); #endif - std::list::iterator it; + SimpleList::iterator it; for (it = tTasks.begin(); it != tTasks.end(); ++it){ Task *currentTask = *it; #ifdef DEBUGR @@ -347,7 +347,7 @@ void Sched::run() } } -const std::list& Sched::getTasks() const +const SimpleList& Sched::getTasks() const { return tTasks; } diff --git a/TaskSched.h b/TaskSched.h index dde3cda..2252aa4 100644 --- a/TaskSched.h +++ b/TaskSched.h @@ -3,12 +3,14 @@ #define DEBUGA 1 #include "Arduino.h" -#include +//#include #define TASK_SECOND 1000 #define TASK_MINUTE 60*TASK_SECOND +#include "SimpleList.h" + + class Task; -using voidFuncTypeWith = std::function; // was typedef std::function voidFuncTypeWith; class InitialState { @@ -192,12 +194,13 @@ Task t2(dummy, 2.0, false, 20, "On2", * false); /** return true if the scheduler is enabled */ int isEnabled(); /** returns a list of the tasks */ - const std::list& getTasks() const; + //const std::list& getTasks() const; + const SimpleList& getTasks() const; /** called perodically to check if a task should be scheduled */ void run(); private: - std::list tTasks; + SimpleList tTasks; int mSchedEnabled; };