uart: do not reload static timeout as it is already past (static timeout is used to compensate response delay)

This commit is contained in:
Romuald Conty 2011-02-14 13:24:42 +00:00
parent 555c32015c
commit e110a78de7

View file

@ -262,7 +262,7 @@ uart_receive (serial_port sp, byte_t * pbtRx, size_t * pszRx)
*pszRx += res; *pszRx += res;
// Reload timeout with a low value to prevent from waiting too long on slow devices (16x is enought to took at least 1 byte) // Reload timeout with a low value to prevent from waiting too long on slow devices (16x is enought to took at least 1 byte)
tv.tv_usec = uiTimeoutStatic + uiTimeoutPerByte * MIN( iExpectedByteCount, 16 ); tv.tv_usec = uiTimeoutPerByte * MIN( iExpectedByteCount, 16 );
// DBG("Timeout reloaded at: %d µs", tv.tv_usec); // DBG("Timeout reloaded at: %d µs", tv.tv_usec);
} while (byteCount && (iExpectedByteCount > 0)); } while (byteCount && (iExpectedByteCount > 0));