机器人控制系统时钟接口 更多...
结构体 | |
struct | RTimer |
时钟数据结构 更多... | |
类型定义 | |
typedef struct RTimer | RTimer |
时钟数据结构 更多... | |
函数 | |
int | initUserTimer (RTimer *timer, int index, int cycle_times) |
初始化时钟,实现总线整数倍时钟定时 更多... | |
void | userTimer (RTimer *timer) |
定时,按照设置的RTimer.cycle_times返回,定时时间未到,函数阻塞 更多... | |
int | userTimerE (RTimer *timer) |
定时,无论RTimer.cycle_times为多少,按照总线时间返回,总线周期内阻塞,当到达RTimer.cycle_times设置的定时周期返回值为ture(1),否则,为false(0) 更多... | |
机器人控制系统时钟接口
利用initUserTimer()初始化用户定时器数据,设置所采用的定时器索引(0,1,......,9)。代码同一运行期内仅能有一个定时器被使用。 同一索引下userTimer()与userTimerE()为同一定时器。
int initUserTimer | ( | RTimer * | timer, |
int | index, | ||
int | cycle_times | ||
) |
初始化时钟,实现总线整数倍时钟定时
timer | 时钟数据 |
index | 时钟索引 |
cycle_times | 基础总线周期的整数倍 |
void userTimer | ( | RTimer * | timer | ) |
定时,按照设置的RTimer.cycle_times返回,定时时间未到,函数阻塞
timer | 时钟数据 |
int userTimerE | ( | RTimer * | timer | ) |
定时,无论RTimer.cycle_times为多少,按照总线时间返回,总线周期内阻塞,当到达RTimer.cycle_times设置的定时周期返回值为ture(1),否则,为false(0)
timer | 时钟数据 |