I gave the scheduler a crack based on avrOS and the code
from 18348 that I think caused John to add these skeleton files.
Very very basic preemptive task scheduling that runs through the
list of tasks, checks if they are ready to run based on a timer period
(in processor cycles as it uses time.h) and launches them...
Just occurred to me that I should default to main, update in a few seconds.
I tend to spew bad code everywhere when I think something is cool
or useful so it almost definitey won't work. It still needs a
timer (I was thinking of stealing it from the real time clock),
but after that, in an ideal world it would work...
#define STACKSIZE 64
#define MAXTASKS 16
#define PRIORITY_LOWEST 8
int register_task(void (*exec)(void), uint16_t period);
Also available in: Unified diff