| 172 | } |
| 173 | |
| 174 | rt_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 | |
| 202 | rt_err_t rt_cputimer_control(rt_cputimer_t timer, int cmd, void *arg) |
| 203 | { |
nothing calls this directly
no test coverage detected