Ai
1 Star 13 Fork 17

觉皇/SoftTimer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
stimer.h 807 Bytes
一键复制 编辑 原始数据 按行查看 历史
觉皇 提交于 2023-03-28 14:15 +08:00 . update stimer.h.
/*
* stimer.h
*
* Created on: 2021121
* Author: hello
*/
#ifndef STIMER_H_
#define STIMER_H_
#include <stdint.h>
typedef enum
{
STIMER_MODE_SINGLE = 1,
STIMER_MODE_REPEAT = 2,
}stimet_mode_t;
typedef struct _stimer
{
const char* name;
uint32_t timeout_ticks;
uint32_t startup_ticks;
void (*callback)(void* arg);
stimet_mode_t mode;
void* arg;
struct _stimer* next;
}stimer_t;
void stimer_init(stimer_t* timer, const char* name, void (*timeout_callback)(void* arg), void* arg, uint32_t ticks, stimet_mode_t mode);
void stimer_start(stimer_t* timer);
void stimer_stop(stimer_t* timer);
void stimer_restart(stimer_t* timer);
void stimer_poll(void);
void stimer_ticks(void);
uint32_t stimer_getticks(const stimer_t* timer);
#endif /* STIMER_H_ */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/jhembed/SoftTimer.git
git@gitee.com:jhembed/SoftTimer.git
jhembed
SoftTimer
SoftTimer
main

搜索帮助