Skip to content

Commit dcbd04c

Browse files
Add call to set Serial options to prevent CR to CRLF conversion (#311)
Co-authored-by: probonopd <[email protected]>
1 parent aa5a7c7 commit dcbd04c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/serialmididevice.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ CSerialMIDIDevice::~CSerialMIDIDevice (void)
4949
boolean CSerialMIDIDevice::Initialize (void)
5050
{
5151
assert (m_pConfig);
52-
return m_Serial.Initialize (m_pConfig->GetMIDIBaudRate ());
52+
boolean res = m_Serial.Initialize (m_pConfig->GetMIDIBaudRate ());
53+
unsigned ser_options = m_Serial.GetOptions();
54+
// Ensure CR->CRLF translation is disabled for MIDI links
55+
ser_options &= ~(SERIAL_OPTION_ONLCR);
56+
m_Serial.SetOptions(ser_options);
57+
return res;
5358
}
5459

5560
void CSerialMIDIDevice::Process (void)

0 commit comments

Comments
 (0)