diff options
author | Pavel Vymetálek <pavel@vym.cz> | 2023-01-11 11:48:01 +0100 |
---|---|---|
committer | Pavel Vymetálek <pavel@vym.cz> | 2023-01-11 11:48:01 +0100 |
commit | af2ed1c080cc5a8635a498b9dbcc66d230024969 (patch) | |
tree | 5ac5b7fc45f5a187ab2f5ff96b45adf90db12ed8 /sercp.c | |
parent | 087ff0d8a5e036c6cff66c97cfa1a322f55fadfa (diff) | |
download | sercp-pc-af2ed1c080cc5a8635a498b9dbcc66d230024969.tar.gz |
Serial port inicialization with flow control "none" for Windows
Diffstat (limited to 'sercp.c')
-rw-r--r-- | sercp.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -693,8 +693,13 @@ int OpenUart() { sDCB.fAbortOnError = TRUE; sDCB.fOutxDsrFlow = FALSE; sDCB.fDtrControl = DTR_CONTROL_DISABLE; - sDCB.fRtsControl = RTS_CONTROL_HANDSHAKE; - sDCB.fOutxCtsFlow = TRUE; + if (is_flow_control_none) { + sDCB.fRtsControl = RTS_CONTROL_DISABLE; + sDCB.fOutxCtsFlow = FALSE; + } else { + sDCB.fRtsControl = RTS_CONTROL_HANDSHAKE; + sDCB.fOutxCtsFlow = TRUE; + } if (SetCommState(serial_fd, &sDCB) == 0) { return (-1); } |