fix: 修正API生成逻辑中2024库的url
[LuatOS.git] / luat / include / luat_rtos_legacy.h
blob1f354b5f0752f552f62041a461d65e062eed925d
1 #ifndef LUAT_RTOS_LEGACY_H
2 #define LUAT_RTOS_LEGACY_H
4 #include "luat_base.h"
5 typedef struct
7 uint32_t id;
8 uint32_t param1;
9 uint32_t param2;
10 uint32_t param3;
11 }luat_event_t;
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
16 #endif
18 #ifndef LUAT_RT_RET
19 #define LUAT_RT_RET
20 #endif
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
26 #endif
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);
49 #endif