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
| #ifndef OS_TASK_H
| #define OS_TASK_H
| #include <stdio.h>
| #ifdef __cplusplus
| extern "C" {
| #endif
|
| typedef void(*TASK_FUNC)(void*);
|
| typedef struct _OS_TASK_MSG {
| TASK_FUNC func; //函数
| int cycle_tick; //时钟周期
| int work_tick;
| int cur_tick; //当前时钟计数
| void *par; //参数
| } OS_TASK_MSG;
|
|
| int InitOSTaskQueue(OS_TASK_MSG* p_task, int cnt);
| int OSTaskCreate(TASK_FUNC func, int tick,int work_tick, void* par);
| void OSSchedule(void(*GetTick)());
|
| #ifdef __cplusplus
| }
| #endif
|
| #endif
|
|