* 判断FIFO是否为空 * @uartx 串口号 * @ret TRUE or FALSE */
| 142 | * @ret TRUE or FALSE |
| 143 | */ |
| 144 | BOOL uart_is_transmit_empty(ls1c_uart_t uartx) |
| 145 | { |
| 146 | void *uart_base = uart_get_base(uartx); |
| 147 | unsigned char status = reg_read_8(uart_base + LS1C_UART_LSR_OFFSET); |
| 148 | |
| 149 | if (status & (LS1C_UART_LSR_TE | LS1C_UART_LSR_TFE)) |
| 150 | { |
| 151 | return TRUE; |
| 152 | } |
| 153 | else |
| 154 | { |
| 155 | return FALSE; |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | |
| 160 | /* |
no test coverage detected