RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
timer.c 文件参考
#include <rtthread.h>
#include <rthw.h>
#include <rtdbg.h>
+ timer.c 的引用(Include)关系图:

浏览该文件的源代码.

宏定义

#define DBG_TAG   "kernel.timer"
 
#define DBG_LVL   DBG_INFO
 

函数

rt_inline struct rt_spinlock_timerlock_idx (struct rt_timer *timer)
 
rt_inline void _timer_remove (rt_timer_t timer)
 
void rt_timer_dump (rt_list_t timer_heads[])
 
void rt_timer_init (rt_timer_t timer, const char *name, void(*timeout)(void *parameter), void *parameter, rt_tick_t time, rt_uint8_t flag)
 
 RTM_EXPORT (rt_timer_init)
 
rt_err_t rt_timer_detach (rt_timer_t timer)
 
 RTM_EXPORT (rt_timer_detach)
 
rt_timer_t rt_timer_create (const char *name, void(*timeout)(void *parameter), void *parameter, rt_tick_t time, rt_uint8_t flag)
 
 RTM_EXPORT (rt_timer_create)
 
rt_err_t rt_timer_delete (rt_timer_t timer)
 
 RTM_EXPORT (rt_timer_delete)
 
rt_err_t rt_timer_start (rt_timer_t timer)
 
 RTM_EXPORT (rt_timer_start)
 
rt_err_t rt_timer_stop (rt_timer_t timer)
 
 RTM_EXPORT (rt_timer_stop)
 
rt_err_t rt_timer_control (rt_timer_t timer, int cmd, void *arg)
 
 RTM_EXPORT (rt_timer_control)
 
void rt_timer_check (void)
 
rt_tick_t rt_timer_next_timeout_tick (void)
 
void rt_system_timer_init (void)
 
void rt_system_timer_thread_init (void)
 

宏定义说明

◆ DBG_TAG

#define DBG_TAG   "kernel.timer"

在文件 timer.c30 行定义.

◆ DBG_LVL

#define DBG_LVL   DBG_INFO

在文件 timer.c31 行定义.

函数说明

◆ _timerlock_idx()

rt_inline struct rt_spinlock * _timerlock_idx ( struct rt_timer * timer)

在文件 timer.c96 行定义.

97{
98#ifdef RT_USING_TIMER_ALL_SOFT
99 return &_stimer_lock;
100#else
101#ifdef RT_USING_TIMER_SOFT
103 {
104 return &_stimer_lock;
105 }
106 else
107#endif /* RT_USING_TIMER_SOFT */
108 {
109 return &_htimer_lock;
110 }
111#endif
112}
#define RT_TIMER_FLAG_SOFT_TIMER
rt_uint8_t flag
struct rt_object parent

引用了 rt_object::flag, rt_timer::parent , 以及 RT_TIMER_FLAG_SOFT_TIMER.

+ 这是这个函数的调用关系图:

◆ _timer_remove()

rt_inline void _timer_remove ( rt_timer_t timer)

Remove the timer

参数
timerthe point of the timer

在文件 timer.c191 行定义.

192{
193 int i;
194
195 for (i = 0; i < RT_TIMER_SKIP_LIST_LEVEL; i++)
196 {
197 rt_list_remove(&timer->row[i]);
198 }
199}
#define RT_TIMER_SKIP_LIST_LEVEL
rt_inline void rt_list_remove(rt_list_t *n)
remove node from list.
rt_list_t row[RT_TIMER_SKIP_LIST_LEVEL]

引用了 rt_timer::row, rt_list_remove() , 以及 RT_TIMER_SKIP_LIST_LEVEL.

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ rt_timer_dump()

void rt_timer_dump ( rt_list_t timer_heads[])

dump the all timer information

参数
timer_headsthe head of timer

在文件 timer.c225 行定义.

226{
227 rt_list_t *list;
228
229 for (list = timer_heads[RT_TIMER_SKIP_LIST_LEVEL - 1].next;
230 list != &timer_heads[RT_TIMER_SKIP_LIST_LEVEL - 1];
231 list = list->next)
232 {
233 struct rt_timer *timer = rt_list_entry(list,
234 struct rt_timer,
236 rt_kprintf("%d", _timer_count_height(timer));
237 }
238 rt_kprintf("\n");
239}
#define rt_kprintf(...)
#define rt_list_entry(node, type, member)
get the struct for this entry
struct rt_list_node rt_list_t
struct rt_list_node * next

引用了 rt_list_node::next, rt_timer::row, rt_kprintf, rt_list_entry , 以及 RT_TIMER_SKIP_LIST_LEVEL.