leOS - a simple taskmanager/scheduler

Yes, I've designed it to be indipendent so it can run tasks in the background without interfering with the main loop.
If you want to see more clearly what leOS can do, try the sketch with 3 LEDs.
You'll see that a LED is driven by the main loop, the other 2 are flashed by 2 indipendent tasks. In the main loop there's also a piece of code that every 10 seconds pauses a task and then resumes it again.

//include the OS
#include "leOS.h"

leOS myOS; //create a new istance of the class leOS

//variabiles to control the LEDs
byte led1Status = 0;
byte led2Status = 0;
byte led3Status = 0;
const byte LED1 = 7;
const byte LED2 = 8;
const byte LED3 = 9;
byte counter = 10;
char direction = -1;


//program setup
void setup() {
    myOS.begin(); //initialize the scheduler
    pinMode(LED1, OUTPUT);
    pinMode(LED2, OUTPUT);
    pinMode(LED3, OUTPUT);
    
    //add the tasks at the scheduler
    myOS.addTask(flashLed1, 600);
    myOS.addTask(flashLed2, 350);
}


//main loop
void loop() {
    digitalWrite(LED2, led2Status);
    led2Status ^= 1;    
    delay(1000);
    
    //every 10 secs pause/restart the second task
    counter += direction;
    if (counter == 0) {
        myOS.pauseTask(flashLed1); //pause the task
        direction = 1;
    }
    if (counter == 10) {
        myOS.restartTask(flashLed1); //restart the task
        direction = -1;
    }
}


//first task
void flashLed1() {
    led1Status^=1;
    digitalWrite(LED1, led1Status);
}


//second task
void flashLed2() {
    led3Status^=1;
    digitalWrite(LED3, led3Status);
}

Let me show you another example.
This is the sketch BlinkWithoutMillis (funny name, isn't it ;)):

//include the OS
#include "leOS.h"

leOS myOS; //create a new istance of the class leOS

//variabiles to control the LEDs
byte led1Status = 0;
const byte LED1 = 13;

//program setup
void setup() {
    myOS.begin(); //initialize the scheduler
    pinMode(LED1, OUTPUT);
    
    //add the tasks at the scheduler
    myOS.addTask(flashLed1, 1000);
}


//main loop
void loop() {
    //empty
}


//flashing task
void flashLed1() {
    led1Status^=1;
    digitalWrite(LED1, led1Status);
}

You can see that the main loop doesn't contain ANY code, by the way the led on the thirtheen pin will flash every 1 second.