mirror of
https://github.com/pine64/blisp.git
synced 2026-09-18 20:11:32 +00:00
Drain TX and flush RX only in UART mode
This commit is contained in:
@@ -185,8 +185,10 @@ blisp_device_handshake(struct blisp_device* device, bool in_ef_loader) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!in_ef_loader && !device->is_usb) {
|
||||||
sp_drain(serial_port); // Wait for write to send all data
|
sp_drain(serial_port); // Wait for write to send all data
|
||||||
sp_flush(serial_port, SP_BUF_INPUT); // Flush garbage out of RX
|
sp_flush(serial_port, SP_BUF_INPUT); // Flush garbage out of RX
|
||||||
|
}
|
||||||
|
|
||||||
ret = sp_blocking_read(serial_port, device->rx_buffer, 2, 50);
|
ret = sp_blocking_read(serial_port, device->rx_buffer, 2, 50);
|
||||||
if (ret >= 2) {
|
if (ret >= 2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user