imu rev1
Fork of AIviate by
control.h@5:d85bac38cdff, 2013-11-26 (annotated)
- Committer:
- team10
- Date:
- Tue Nov 26 20:29:54 2013 +0000
- Revision:
- 5:d85bac38cdff
- Parent:
- 4:44a5b1e8fd27
imu rev1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
teamgoat | 0:0c627ff4c5ed | 1 | #ifndef CONTROL_H |
teamgoat | 0:0c627ff4c5ed | 2 | #define CONTROL_H |
teamgoat | 0:0c627ff4c5ed | 3 | |
teamgoat | 4:44a5b1e8fd27 | 4 | #define OUTPUT_SIZE 512 |
teamgoat | 4:44a5b1e8fd27 | 5 | #define MAX_SID_LEN 32 |
teamgoat | 2:452dd766d212 | 6 | |
teamgoat | 4:44a5b1e8fd27 | 7 | char* get_output(int); |
teamgoat | 4:44a5b1e8fd27 | 8 | void init(); |
teamgoat | 4:44a5b1e8fd27 | 9 | void schedule(); |
teamgoat | 4:44a5b1e8fd27 | 10 | int schedule_proc(char *sid, int (*funcptr)(int)); |
teamgoat | 0:0c627ff4c5ed | 11 | |
teamgoat | 0:0c627ff4c5ed | 12 | typedef enum |
teamgoat | 0:0c627ff4c5ed | 13 | { |
teamgoat | 0:0c627ff4c5ed | 14 | READY, |
teamgoat | 0:0c627ff4c5ed | 15 | BLOCKED, |
teamgoat | 0:0c627ff4c5ed | 16 | ZOMBIE, |
teamgoat | 0:0c627ff4c5ed | 17 | EMPTY |
teamgoat | 0:0c627ff4c5ed | 18 | } proc_stat; |
teamgoat | 0:0c627ff4c5ed | 19 | |
teamgoat | 4:44a5b1e8fd27 | 20 | typedef struct |
teamgoat | 4:44a5b1e8fd27 | 21 | { |
teamgoat | 4:44a5b1e8fd27 | 22 | // process status |
teamgoat | 4:44a5b1e8fd27 | 23 | unsigned int status; |
teamgoat | 4:44a5b1e8fd27 | 24 | // if status == BLOCKED, wait till block_pid's status is ZOMBIE |
teamgoat | 4:44a5b1e8fd27 | 25 | unsigned int block_pid; |
teamgoat | 4:44a5b1e8fd27 | 26 | // function. each "process" is a function with a number of properties and storage space |
teamgoat | 4:44a5b1e8fd27 | 27 | int (*start)(int); |
teamgoat | 4:44a5b1e8fd27 | 28 | char sid[MAX_SID_LEN]; |
teamgoat | 4:44a5b1e8fd27 | 29 | char output[OUTPUT_SIZE]; |
teamgoat | 4:44a5b1e8fd27 | 30 | } process; |
teamgoat | 4:44a5b1e8fd27 | 31 | |
teamgoat | 0:0c627ff4c5ed | 32 | #endif //CONTROL_H |