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

Function rt_timer_check

src/timer.c:748–773  ·  view source on GitHub ↗

* @brief This function will check timer list, if a timeout event happens, * the corresponding timeout function will be invoked. * * @note This function shall be invoked in operating system timer interrupt. */

Source from the content-addressed store, hash-verified

746 * @note This function shall be invoked in operating system timer interrupt.
747 */
748void rt_timer_check(void)
749{
750 RT_ASSERT(rt_interrupt_get_nest() > 0);
751
752#ifdef RT_USING_SMP
753 /* Running on core 0 only */
754 if (rt_cpu_get_id() != 0)
755 {
756 return;
757 }
758#endif
759
760#ifdef RT_USING_TIMER_SOFT
761 rt_err_t ret = RT_ERROR;
762 rt_tick_t next_timeout;
763
764 ret = _timer_list_next_timeout(_soft_timer_list, &next_timeout);
765 if ((ret == RT_EOK) && (next_timeout <= rt_tick_get()))
766 {
767 rt_sem_release(&_soft_timer_sem);
768 }
769#endif
770#ifndef RT_USING_TIMER_ALL_SOFT
771 _timer_check(_timer_list, &_htimer_lock);
772#endif
773}
774
775/**
776 * @brief This function will return the next timeout tick in the system.

Callers 3

sleep_tick_adjustFunction · 0.85
rt_tick_increaseFunction · 0.85
rt_tick_increase_tickFunction · 0.85

Calls 6

rt_interrupt_get_nestFunction · 0.85
rt_cpu_get_idFunction · 0.85
_timer_list_next_timeoutFunction · 0.85
rt_tick_getFunction · 0.85
rt_sem_releaseFunction · 0.85
_timer_checkFunction · 0.85

Tested by

no test coverage detected