avrdude: Fix serial I/O timeout on Windows
This commit is contained in:
parent
4723a99b15
commit
4f4649d046
1 changed files with 4 additions and 2 deletions
|
@ -90,8 +90,10 @@ static BOOL serial_w32SetTimeOut(HANDLE hComPort, DWORD timeout) // in ms
|
||||||
{
|
{
|
||||||
COMMTIMEOUTS ctmo;
|
COMMTIMEOUTS ctmo;
|
||||||
ZeroMemory (&ctmo, sizeof(COMMTIMEOUTS));
|
ZeroMemory (&ctmo, sizeof(COMMTIMEOUTS));
|
||||||
ctmo.ReadIntervalTimeout = timeout;
|
// Don't use the two other two values, set them to zero. This way a constant timeout is used
|
||||||
ctmo.ReadTotalTimeoutMultiplier = timeout;
|
// for the following reads.
|
||||||
|
// ctmo.ReadIntervalTimeout = timeout;
|
||||||
|
// ctmo.ReadTotalTimeoutMultiplier = timeout;
|
||||||
ctmo.ReadTotalTimeoutConstant = timeout;
|
ctmo.ReadTotalTimeoutConstant = timeout;
|
||||||
|
|
||||||
return SetCommTimeouts(hComPort, &ctmo);
|
return SetCommTimeouts(hComPort, &ctmo);
|
||||||
|
|
Loading…
Add table
Reference in a new issue