Add a small delay before flushing the serial line.
Sometimes there are a few garbages bytes received before the preamble bytes. This typically happens when trying to download again after a failed attempt. However trying to flush them immediately after opening the serial port doesn't work.
This commit is contained in:
parent
8cec4d0a42
commit
a5f8c8cfff
@ -157,6 +157,7 @@ hw_ostc_device_open (device_t **out, const char* name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure everything is in a sane state.
|
// Make sure everything is in a sane state.
|
||||||
|
serial_sleep (100);
|
||||||
serial_flush (device->port, SERIAL_QUEUE_BOTH);
|
serial_flush (device->port, SERIAL_QUEUE_BOTH);
|
||||||
|
|
||||||
*out = (device_t*) device;
|
*out = (device_t*) device;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user