MCPcopy Index your code
hub / github.com/RT-Thread/rt-thread / rt_timer_init

Function rt_timer_init

src/timer.c:267–283  ·  view source on GitHub ↗

* @brief This function will initialize a timer * normally this function is used to initialize a static timer object. * * @param timer is the point of timer * * @param name is a pointer to the name of the timer * * @param timeout is the callback of timer * * @param parameter is the param of the callback * * @param time is timeout ticks of timer * * NOTE: The max time

Source from the content-addressed store, hash-verified

265 *
266 */
267void rt_timer_init(rt_timer_t timer,
268 const char *name,
269 void (*timeout)(void *parameter),
270 void *parameter,
271 rt_tick_t time,
272 rt_uint8_t flag)
273{
274 /* parameter check */
275 RT_ASSERT(timer != RT_NULL);
276 RT_ASSERT(timeout != RT_NULL);
277 RT_ASSERT(time < RT_TICK_MAX / 2);
278
279 /* timer object initialization */
280 rt_object_init(&(timer->parent), RT_Object_Class_Timer, name);
281
282 _timer_init(timer, timeout, parameter, time, flag);
283}
284RTM_EXPORT(rt_timer_init);
285
286/**

Callers 15

rt_hw_can_registerFunction · 0.85
rt_led_registerFunction · 0.85
rt_sdhci_init_hostFunction · 0.85
rt_wlan_initFunction · 0.85
rt_lptimer_initFunction · 0.85
rt_soft_rtc_initFunction · 0.85
rt_link_initFunction · 0.85
rt_macb_initFunction · 0.85

Calls 2

rt_object_initFunction · 0.85
_timer_initFunction · 0.70

Tested by 6

test_static_timerFunction · 0.68
test_timer_stressFunction · 0.68