aboutsummaryrefslogtreecommitdiff
path: root/src/sys/schedule.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/schedule.h')
-rw-r--r--src/sys/schedule.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/sys/schedule.h b/src/sys/schedule.h
new file mode 100644
index 0000000..04dad6a
--- /dev/null
+++ b/src/sys/schedule.h
@@ -0,0 +1,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