| 148 | } |
| 149 | |
| 150 | static int uart_msg_getc(struct rt_serial_device *serial) |
| 151 | { |
| 152 | int ch; |
| 153 | struct drv_usart_msg *uart_msg = RT_NULL; |
| 154 | FUartMsg *uart_msg_ptr = RT_NULL; |
| 155 | RT_ASSERT(serial != RT_NULL); |
| 156 | |
| 157 | uart_msg = rt_container_of(serial, struct drv_usart_msg, serial); |
| 158 | uart_msg_ptr = uart_msg->handle; |
| 159 | |
| 160 | |
| 161 | if(RT_RINGBUFFER_EMPTY == rt_ringbuffer_status(recv_ringbuffer)) |
| 162 | { |
| 163 | FUartMsgRecvBufferNoBlocking(uart_msg_ptr); |
| 164 | } |
| 165 | |
| 166 | if(0 == rt_ringbuffer_getchar(recv_ringbuffer, (rt_uint8_t *)&ch)) |
| 167 | { |
| 168 | return -1; |
| 169 | } |
| 170 | |
| 171 | if (ch == 0xffff) |
| 172 | { |
| 173 | ch = -1; |
| 174 | } |
| 175 | else |
| 176 | { |
| 177 | ch &= 0xff; |
| 178 | } |
| 179 | |
| 180 | return ch; |
| 181 | } |
| 182 | |
| 183 | static void Ft_Os_Uart_Msg_Callback(void *Args, u32 Event, u32 EventData) |
| 184 | { |
nothing calls this directly
no test coverage detected