Skip to content

请加个函数 #10284

@htl5241

Description

@htl5241

Describe problem solved by the proposed feature

因为驱动里经常要调用超时判断功能 , linux 和 uboot 都有相似函数。
还有请加bitops , linux 和 uboot 都有 ,经常用的。

Describe your preferred solution

rt_tick_t rt_delta_tick_get(rt_tick_t last_time)
{
rt_tick_t tnow = rt_tick_get();
if (tnow >= last_time) {
return (tnow - last_time);
} else {
return (RT_TICK_MAX - last_time + tnow + 1);
}
}

bitops 可以从linux 或 uboot 移植过来

Describe possible alternatives

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions