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:
Jef Driesen 2012-04-13 22:50:13 +02:00
parent 8cec4d0a42
commit a5f8c8cfff

View File

@ -157,6 +157,7 @@ hw_ostc_device_open (device_t **out, const char* name)
}
// Make sure everything is in a sane state.
serial_sleep (100);
serial_flush (device->port, SERIAL_QUEUE_BOTH);
*out = (device_t*) device;