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

Function rt_cputimer_stop

components/drivers/cputime/cputimer.c:174–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174rt_err_t rt_cputimer_stop(rt_cputimer_t timer)
175{
176 rt_base_t level;
177
178 /* disable interrupt */
179 level = rt_hw_interrupt_disable();
180
181 /* timer check */
182 RT_ASSERT(timer != RT_NULL);
183 RT_ASSERT(clock_cpu_issettimeout() != RT_FALSE);
184
185 if (!(timer->parent.flag & RT_TIMER_FLAG_ACTIVATED))
186 {
187 rt_hw_interrupt_enable(level);
188 return -RT_ERROR;
189 }
190
191 rt_list_remove(&timer->row);
192 /* change status */
193 timer->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;
194
195 _set_next_timeout();
196 /* enable interrupt */
197 rt_hw_interrupt_enable(level);
198
199 return RT_EOK;
200}
201
202rt_err_t rt_cputimer_control(rt_cputimer_t timer, int cmd, void *arg)
203{

Callers

nothing calls this directly

Calls 5

clock_cpu_issettimeoutFunction · 0.85
rt_list_removeFunction · 0.85
_set_next_timeoutFunction · 0.85
rt_hw_interrupt_disableFunction · 0.50
rt_hw_interrupt_enableFunction · 0.50

Tested by

no test coverage detected