* @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. */
| 746 | * @note This function shall be invoked in operating system timer interrupt. |
| 747 | */ |
| 748 | void 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. |
no test coverage detected