Added CLRDTR and SETDTR to setBaudRate

Fixes hang in Windows with Adafruit Floppy GreaseWeazle
This commit is contained in:
p-j-b
2024-04-01 22:33:31 +01:00
parent a7967b6dc3
commit c2248c7e4a

View File

@@ -97,6 +97,12 @@ public:
.Parity = NOPARITY,
.StopBits = ONESTOPBIT};
SetCommState(_handle, &dcb);
if (!EscapeCommFunction(_handle, CLRDTR))
error("Couldn't clear DTR: {}", get_last_error_string());
Sleep(200);
if (!EscapeCommFunction(_handle, SETDTR))
error("Couldn't set DTR: {}", get_last_error_string());
}
private: