leOS - a simple taskmanager/scheduler

Looks cool.
I was looking at your source and wondering:

  • Why don't you make a 'task' struct. That would be a more intuitive approach in your library because you would only need one array instead of four or five distinct arrays for each task.
  • Why don't you allocate the array(s) to dynamic memory so that you can resize it in addTask() (and possibly removeTask()) as necessary. Is there a good reason to be limited to 9 tasks?
  • In your source there are two places where you slide all of the array elements over to fill in a gap (in removeTask() and ISR() interrupt handler when cleaning out one time functions). I recommend you either break the common code out into a common function or just call removeTask() from ISR(). It will make your code easier to read and it will do magical things to your code size.
  • I see that you declare
const uint8_t ONETIME=2;
const uint8_t SCHEDULED=1;

inside your header, but you never actually bother to use them anywhere in the code. Better than arbitrary constant ints would be to use an enum, that way using the name in place of the raw integer is enforced by the compiler.