equal
deleted
inserted
replaced
11 #include <sys/mman.h> |
11 #include <sys/mman.h> |
12 #include <sys/fcntl.h> |
12 #include <sys/fcntl.h> |
13 |
13 |
14 #include <native/task.h> |
14 #include <native/task.h> |
15 #include <native/timer.h> |
15 #include <native/timer.h> |
16 #include <native/mutex.h> |
|
17 #include <native/sem.h> |
16 #include <native/sem.h> |
18 #include <native/pipe.h> |
17 #include <native/pipe.h> |
19 |
18 |
20 unsigned int PLC_state = 0; |
19 unsigned int PLC_state = 0; |
21 #define PLC_STATE_TASK_CREATED 1 |
20 #define PLC_STATE_TASK_CREATED 1 |
73 rt_task_set_periodic(&PLC_task, current_time + next, rt_timer_ns2ticks(period)); |
72 rt_task_set_periodic(&PLC_task, current_time + next, rt_timer_ns2ticks(period)); |
74 } |
73 } |
75 |
74 |
76 void PLC_task_proc(void *arg) |
75 void PLC_task_proc(void *arg) |
77 { |
76 { |
78 PLC_SetTimer(Ttick, Ttick); |
77 PLC_SetTimer(common_ticktime__, common_ticktime__); |
79 |
78 |
80 while (!PLC_shutdown) { |
79 while (!PLC_shutdown) { |
81 PLC_GetTime(&__CURRENT_TIME); |
80 PLC_GetTime(&__CURRENT_TIME); |
82 __run(); |
81 __run(); |
83 if (PLC_shutdown) break; |
82 if (PLC_shutdown) break; |