Timer-based Task Scheduler
Implement a cooperative task scheduler in C using a periodic timer tick. The scheduler maintains task table with function pointers and intervals.
Constraints
- tick() increments global counter.
- scheduler() walks tasks.
- task structure: fn, period, last_run.
- No preemption.
- Add and run tasks.
1typedef void (*taskfn)();2void tick();3void scheduler();