Reduce the size of the AVRDriver code.
Colorize the changed parameter. Warning reduction across all files.
This commit is contained in:
@@ -37,7 +37,7 @@ bool CSerialPort::Open(LPCTSTR PortName, uint32_t BaudRate, BYTE ByteSize, BYTE
|
||||
Close();
|
||||
m_PortHandle = CreateFile(PortName, DesiredAccess, 0, NULL, OPEN_EXISTING, 0, 0);
|
||||
if (m_PortHandle != INVALID_HANDLE_VALUE) {
|
||||
DCB dcb;
|
||||
DCB dcb = { 0 };
|
||||
CString s;
|
||||
dcb.DCBlength = sizeof(dcb);
|
||||
GetCommState(m_PortHandle, &dcb);
|
||||
@@ -66,7 +66,7 @@ bool CSerialPort::Open(LPCTSTR PortName, uint32_t BaudRate, BYTE ByteSize, BYTE
|
||||
|
||||
SetCommState(m_PortHandle, &dcb);
|
||||
|
||||
COMMTIMEOUTS touts;
|
||||
COMMTIMEOUTS touts = { 0 };;
|
||||
touts.ReadIntervalTimeout = UINT32_MAX; // This, plus the zero timeouts causes immediate return
|
||||
touts.ReadTotalTimeoutMultiplier = 0;
|
||||
touts.ReadTotalTimeoutConstant = 0;
|
||||
|
||||
Reference in New Issue
Block a user