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

Function uart_irq_handler

bsp/loongson/ls1cdev/drivers/drv_uart.c:99–118  ·  view source on GitHub ↗

UART interrupt handler */

Source from the content-addressed store, hash-verified

97
98/* UART interrupt handler */
99static void uart_irq_handler(int vector, void *param)
100{
101 struct rt_serial_device *serial = (struct rt_serial_device *)param;
102 struct rt_uart_ls1c *uart_dev = RT_NULL;
103
104 RT_ASSERT(serial != RT_NULL);
105
106 uart_dev = (struct rt_uart_ls1c *)serial->parent.user_data;
107 void *uart_base = uart_get_base(uart_dev->UARTx);
108 unsigned char iir = reg_read_8(uart_base + LS1C_UART_IIR_OFFSET);
109
110 // 判断是否为接收超时或接收到有效数据
111 if ((IIR_RXTOUT & iir) || (IIR_RXRDY & iir))
112 {
113 rt_interrupt_enter();
114 rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
115 rt_interrupt_leave();
116 }
117
118}
119
120static const struct rt_uart_ops ls1c_uart_ops =
121{

Callers

nothing calls this directly

Calls 5

uart_get_baseFunction · 0.50
reg_read_8Function · 0.50
rt_interrupt_enterFunction · 0.50
rt_hw_serial_isrFunction · 0.50
rt_interrupt_leaveFunction · 0.50

Tested by

no test coverage detected