第一次提交
This commit is contained in:
35
app/app_frm_timer.h
Normal file
35
app/app_frm_timer.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef APP_FRM_TIMER_H
|
||||
#define APP_FRM_TIMER_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAX_TIMERS 100 // 定义最大定时器数量
|
||||
|
||||
// 定时器结构体定义
|
||||
typedef struct Timer {
|
||||
uint32_t target_time;
|
||||
uint32_t elapsed_time;
|
||||
uint32_t start_time;
|
||||
unsigned char active;
|
||||
unsigned char priority;
|
||||
struct Timer *next;
|
||||
} Timer;
|
||||
|
||||
// 函数声明
|
||||
void timerInit(Timer *timer);
|
||||
void timerStart(Timer *timer, uint32_t target_time, unsigned char priority);
|
||||
void timerStop(Timer *timer);
|
||||
void timerUpdateAll(void);
|
||||
uint32_t getCurrentTimerCount(void);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // APP_FRM_TIMER_H
|
||||
Reference in New Issue
Block a user