Skip to content

Commit

Permalink
Merge pull request #749 from p-j-b/fix-hang-windows-adafruit-floppy-g…
Browse files Browse the repository at this point in the history
…reaseweazle

Set DTR after calling SetCommState
  • Loading branch information
davidgiven authored May 1, 2024
2 parents c064aa7 + c2248c7 commit f0b1b61
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/usb/serial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ class SerialPortImpl : public SerialPort
.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:
Expand Down

0 comments on commit f0b1b61

Please sign in to comment.