#ifndef TASK_H #define TASK_H #define MAX_TASKS 2 typedef struct { unsigned int regs[13]; // r0-r12 unsigned int sp; unsigned int lr; } context_t; typedef struct { context_t context; unsigned int stack[256]; } task_t; void task_init(void); void task_schedule(void); extern task_t tasks[MAX_TASKS]; extern int current_task; #endif