Increase the read timeout to 4 seconds.

When the OSTC receives the download dives command, it responds
immediately with the preamble bytes. But then it does a linear search
through its internal memory to locate the end-of-profile marker. As a
result the response time increases when the marker is located near the
end of the memory area. In the worst case scenario, the response time
can exceed the 3 second read timeout with a few milliseconds.

Since the required timeout depends on the total amount of profile
memory, this problem was indirectly introduced with firmware v1.91,
which doubled the amount of profile memory from 32K to 64K.
This commit is contained in:
Jef Driesen 2012-04-13 21:35:33 +02:00
parent a2f4f1cd3f
commit 8cec4d0a42

View File

@ -148,8 +148,8 @@ hw_ostc_device_open (device_t **out, const char* name)
return DEVICE_STATUS_IO;
}
// Set the timeout for receiving data (3000ms).
if (serial_set_timeout (device->port, 3000) == -1) {
// Set the timeout for receiving data.
if (serial_set_timeout (device->port, 4000) == -1) {
WARNING ("Failed to set the timeout.");
serial_close (device->port);
free (device);