From 4f4649d0464cfd67ccd5bb48013785612f9ceccf Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 21 May 2018 14:33:48 +0200 Subject: [PATCH] avrdude: Fix serial I/O timeout on Windows --- xs/src/avrdude/ser_win32.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xs/src/avrdude/ser_win32.c b/xs/src/avrdude/ser_win32.c index a284774c2..b1f161291 100644 --- a/xs/src/avrdude/ser_win32.c +++ b/xs/src/avrdude/ser_win32.c @@ -90,8 +90,10 @@ static BOOL serial_w32SetTimeOut(HANDLE hComPort, DWORD timeout) // in ms { COMMTIMEOUTS ctmo; ZeroMemory (&ctmo, sizeof(COMMTIMEOUTS)); - ctmo.ReadIntervalTimeout = timeout; - ctmo.ReadTotalTimeoutMultiplier = timeout; + // Don't use the two other two values, set them to zero. This way a constant timeout is used + // for the following reads. + // ctmo.ReadIntervalTimeout = timeout; + // ctmo.ReadTotalTimeoutMultiplier = timeout; ctmo.ReadTotalTimeoutConstant = timeout; return SetCommTimeouts(hComPort, &ctmo);