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

Function rt_timer_create

src/timer.c:345–367  ·  view source on GitHub ↗

* @brief This function will create a timer * * @param name is the name of timer * * @param timeout is the timeout function * * @param parameter is the parameter of timeout function * * @param time is timeout ticks of the timer * * NOTE: The max timeout tick should be no more than (RT_TICK_MAX/2 - 1). * * @param flag is the flag of timer. Timer will invoke the timeout function ac

Source from the content-addressed store, hash-verified

343 * @return the created timer object
344 */
345rt_timer_t rt_timer_create(const char *name,
346 void (*timeout)(void *parameter),
347 void *parameter,
348 rt_tick_t time,
349 rt_uint8_t flag)
350{
351 struct rt_timer *timer;
352
353 /* parameter check */
354 RT_ASSERT(timeout != RT_NULL);
355 RT_ASSERT(time < RT_TICK_MAX / 2);
356
357 /* allocate a object */
358 timer = (struct rt_timer *)rt_object_allocate(RT_Object_Class_Timer, name);
359 if (timer == RT_NULL)
360 {
361 return RT_NULL;
362 }
363
364 _timer_init(timer, timeout, parameter, time, flag);
365
366 return timer;
367}
368RTM_EXPORT(rt_timer_create);
369
370/**

Callers 15

sys_rt_timer_createFunction · 0.85
timer_initFunction · 0.85
usb_osal_timer_createFunction · 0.85
timerfd_timeoutFunction · 0.85
timerfd_do_settimeFunction · 0.85
phy_monitor_thread_entryFunction · 0.85
hc32_phy_monitor_threadFunction · 0.85
rtgui_touch_hw_initFunction · 0.85
rt_touch_initFunction · 0.85
OS_TimerCreateFunction · 0.85
osal_timer_createFunction · 0.85
rt_spiSd_initFunction · 0.85

Calls 2

rt_object_allocateFunction · 0.85
_timer_initFunction · 0.70