代码拉取完成,页面将自动刷新
/**
* @file xtimer.h
* @author eric
* @brief
* @version 0.1
* @date 2022-04-16
*
* @copyright Copyright (c) 2022
*
*/
#ifndef _XTIMER_H
#define _XTIMER_H
#include "dlist.h"
#include <stdint.h>
enum option
{
XTIMER_SINGLE = 0,
XTIMER_REPEAT,
};
typedef struct list_node
{
const char *name;
uint32_t timout;
uint32_t start;
void *arg;
void (*callback)(void *arg);
int opt;
struct list_head list;
} list_node_t, xtimer_t;
/**
* @brief start or restart a xtimer
*
* @param timer
* @return int
*/
int xtimer_start(xtimer_t *timer);
/**
* @brief stop a xtimer
*
* @param timer
* @return int 0:ok other:err
*/
int xtimer_stop(xtimer_t *timer);
/**
* @brief Query timer is valid???
*
* @param timer
* @return int 0:vaild, other:invalid
*/
int xtimer_isvalid(xtimer_t *timer);
/**
* @brief get the timer remain ticks
*
* @param timer
* @return int -1:err, other:remain ticks
*/
int xtimer_remain(xtimer_t *timer);
/**
* @brief put to main while(1)
*
*/
void xtimer_loop(void);
/* Get current tick, eg.HAL_GetTicks() */
#ifndef xtimer_get_tick
#define xtimer_get_tick() HAL_GetTick()
#endif // !xtimer_get_tick
#endif // !_XTIMER_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。