| 235 | |
| 236 | rt_section(".irq.usart") |
| 237 | static void uart_isr(int vector, void *param) |
| 238 | { |
| 239 | rt_interrupt_enter(); |
| 240 | |
| 241 | #ifdef BSP_USING_UART0 |
| 242 | if(hal_uart_getflag(UART0_BASE, UART_FLAG_RXPND)) //RX one byte finish |
| 243 | { |
| 244 | uart_obj[0].rx_buf[uart_obj[0].rx_idx++ % 10] = hal_uart_read(UART0_BASE); |
| 245 | hal_uart_clrflag(UART0_BASE, UART_FLAG_RXPND); |
| 246 | uart0_irq_post(); |
| 247 | } |
| 248 | #endif |
| 249 | #ifdef BSP_USING_UART1 |
| 250 | if(hal_uart_getflag(UART1_BASE, UART_FLAG_RXPND)) //RX one byte finish |
| 251 | { |
| 252 | uart_obj[1].rx_buf[uart_obj[1].rx_idx++ % 10] = hal_uart_read(UART1_BASE); |
| 253 | hal_uart_clrflag(UART1_BASE, UART_FLAG_RXPND); |
| 254 | uart1_irq_post(); |
| 255 | } |
| 256 | #endif |
| 257 | #ifdef BSP_USING_UART2 |
| 258 | if(hal_uart_getflag(UART2_BASE, UART_FLAG_RXPND)) //RX one byte finish |
| 259 | { |
| 260 | uart_obj[2].rx_buf[uart_obj[2].rx_idx++ % 10] = hal_uart_read(UART2_BASE); |
| 261 | hal_uart_clrflag(UART2_BASE, UART_FLAG_RXPND); |
| 262 | uart2_irq_post(); |
| 263 | } |
| 264 | #endif |
| 265 | |
| 266 | rt_interrupt_leave(); |
| 267 | } |
| 268 | |
| 269 | #ifdef HUART_ENABLE |
| 270 | rt_section(".irq.huart") |
nothing calls this directly
no test coverage detected