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

Function timer_is_time_out

bsp/loongson/ls1cdev/libraries/ls1c_timer.c:111–135  ·  view source on GitHub ↗

* �ж�ָ����ʱ���Ƿ�ʱ(ʵ�ֶ�ʱ) * @timer_info ��ʱ�� * @ret TRUE or FALSE */

Source from the content-addressed store, hash-verified

109 * @ret TRUE or FALSE
110 */
111BOOL timer_is_time_out(timer_info_t *timer_info)
112{
113 unsigned int timer_reg_base = 0; // �Ĵ�������ַ
114 unsigned int ctrl; // ���ƼĴ�����ֵ
115
116 // ����
117 if (NULL == timer_info)
118 {
119 return FALSE;
120 }
121
122 // ��ȡ���ƼĴ���
123 timer_reg_base = timer_get_reg_base(timer_info->timer);
124 ctrl = reg_read_32((volatile unsigned int *)(timer_reg_base + LS1C_PWM_CTRL));
125
126 // �ж��ж�״̬λ
127 if (ctrl & (1 << LS1C_PWM_INT_SR))
128 {
129 return TRUE;
130 }
131 else
132 {
133 return FALSE;
134 }
135}
136
137
138

Callers

nothing calls this directly

Calls 2

timer_get_reg_baseFunction · 0.85
reg_read_32Function · 0.70

Tested by

no test coverage detected