MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_ktime_hrtimer_init

Function rt_ktime_hrtimer_init

components/drivers/ktime/src/hrtimer.c:176–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void rt_ktime_hrtimer_init(rt_ktime_hrtimer_t timer,
177 const char *name,
178 rt_uint8_t flag,
179 void (*timeout)(void *parameter),
180 void *parameter)
181{
182 /* parameter check */
183 RT_ASSERT(timer != RT_NULL);
184 RT_ASSERT(timeout != RT_NULL);
185
186 rt_memset(timer, 0, sizeof(struct rt_ktime_hrtimer));
187
188 timer->flag = flag & ~RT_TIMER_FLAG_ACTIVATED;
189 timer->timeout_func = timeout;
190 timer->parameter = parameter;
191 rt_strncpy(timer->name, name, RT_NAME_MAX - 1);
192 rt_list_init(&(timer->node));
193 rt_completion_init(&timer->completion);
194}
195
196rt_err_t rt_ktime_hrtimer_start(rt_ktime_hrtimer_t timer, unsigned long delay_cnt)
197{

Callers 2

timer_createFunction · 0.85

Calls 4

rt_memsetFunction · 0.85
rt_strncpyFunction · 0.85
rt_list_initFunction · 0.85
rt_completion_initFunction · 0.50

Tested by

no test coverage detected