blob: 2fd6acd57ba84be0af58545b1921291dfcfe309a (
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
30
|
#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_fxn(void (*task)(void), unsigned char priority);
void add_task(struct Task*);
unsigned int get_task_length(void);
void execute_task(void);
#endif
|