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

Function rt_lptimer_start

components/drivers/pm/lptimer.c:48–72  ·  view source on GitHub ↗

lptimer start */

Source from the content-addressed store, hash-verified

46
47/* lptimer start */
48rt_err_t rt_lptimer_start(rt_lptimer_t timer)
49{
50 rt_base_t level;
51
52 RT_ASSERT(timer != RT_NULL);
53
54 /* disable interrupt */
55 level = rt_hw_interrupt_disable();
56 rt_list_remove(&timer->list); /* remove first */
57 if (rt_timer_start(&timer->timer) == RT_EOK)
58 {
59 /* insert to lptimer list */
60 rt_list_insert_after(&rt_soft_lptimer_list, &(timer->list));
61 }
62 else
63 {
64 /* enable interrupt */
65 rt_hw_interrupt_enable(level);
66 return -RT_ERROR;
67 }
68
69 /* enable interrupt */
70 rt_hw_interrupt_enable(level);
71 return RT_EOK;
72}
73
74/* lptimer stop */
75rt_err_t rt_lptimer_stop(rt_lptimer_t timer)

Callers

nothing calls this directly

Calls 5

rt_list_removeFunction · 0.85
rt_timer_startFunction · 0.85
rt_list_insert_afterFunction · 0.85
rt_hw_interrupt_disableFunction · 0.50
rt_hw_interrupt_enableFunction · 0.50

Tested by

no test coverage detected