1 #ifndef LUAT_RTOS_LEGACY_H
2 #define LUAT_RTOS_LEGACY_H
12 //定时器回调函数需要定义成 LUAT_RT_RET_TYPE fun_name(LUAT_RT_CB_PARAM)
13 //定时器回调函数退出时需要, return LUAT_RT_RET;
14 #ifndef LUAT_RT_RET_TYPE
15 #define LUAT_RT_RET_TYPE void
22 #ifndef LUAT_RT_CB_PARAM
23 #define LUAT_RT_CB_PARAM void
24 //#define LUAT_RT_CB_PARAM void *param
25 //#define LUAT_RT_CB_PARAM void *pdata, void *param
27 /* ----------------------------------- thread ----------------------------------- */
28 LUAT_RET
luat_send_event_to_task(void *task_handle
, uint32_t id
, uint32_t param1
, uint32_t param2
, uint32_t param3
);
29 LUAT_RET
luat_wait_event_from_task(void *task_handle
, uint32_t wait_event_id
, luat_event_t
*out_event
, void *call_back
, uint32_t ms
);
30 void *luat_get_current_task(void);
33 /* -----------------------------------信号量模拟互斥锁,可以在中断中unlock-------------------------------*/
34 void *luat_mutex_create(void);
35 LUAT_RET
luat_mutex_lock(void *mutex
);
36 LUAT_RET
luat_mutex_unlock(void *mutex
);
37 void luat_mutex_release(void *mutex
);
40 /* ----------------------------------- timer ----------------------------------- */
41 void *luat_create_rtos_timer(void *cb
, void *param
, void *task_handle
);
42 int luat_start_rtos_timer(void *timer
, uint32_t ms
, uint8_t is_repeat
);
43 int luat_start_rtos_timer_us(void *timer
, uint32_t us
);
44 void luat_stop_rtos_timer(void *timer
);
45 void luat_release_rtos_timer(void *timer
);
47 void luat_task_suspend_all(void);
48 void luat_task_resume_all(void);