aboutsummaryrefslogtreecommitdiff
path: root/src/sys/schedule.h
blob: 04dad6ad428046f40f120ddf13b6b5d54ca9a146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef SYS_SCHEDULE_H
#define SYS_SCHEDULE_H

struct Task {
	unsigned char priority;
	void (*task)(void);
};

#ifdef FLAT
struct Scheduler {
	struct Task** tasks;
};
#elseif LL
#include "../lib/ll.h"
struct Scheduler {
	struct LL* tasks;
};
#else
#include "../lib/q.h"
struct Scheduler {
	struct Q_base* tasks;
};
#endif

void add_task(struct Task*);
unsigned int get_task_length(void);
void execute_task(void);

#endif