mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-12 00:24:27 -04:00
Disable input and output processing on Unix serial ports
Disabling output processing is necessary since otherwise sending a LF character (ASCII 0x0A) will automatically insert a CR character (ASCII 0x0D). Disabling input processing should prevent this when receiving data.
This commit is contained in:
@@ -318,10 +318,13 @@ bool serial_port::serial_open()
|
||||
options.c_lflag &= ~ECHOE; // Disable erasure
|
||||
options.c_lflag &= ~ECHONL; // Disable new-line echo
|
||||
options.c_lflag &= ~ISIG; // Disable interpretation of INTR, QUIT and SUSP
|
||||
options.c_lflag &= ~IEXTEN; // Disable input processing
|
||||
|
||||
options.c_iflag &= ~(IXON | IXOFF | IXANY); // Turn off s/w flow ctrl
|
||||
options.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL); // Disable any special handling of received bytes
|
||||
|
||||
options.c_oflag &= ~OPOST; // Disable output processing;
|
||||
|
||||
/*-----------------------------------------*\
|
||||
| Set the port configuration options |
|
||||
\*-----------------------------------------*/
|
||||
@@ -420,7 +423,7 @@ bool serial_port::serial_open()
|
||||
/*-----------------------------------------*\
|
||||
| Configure additional parameters |
|
||||
\*-----------------------------------------*/
|
||||
options.c_lflag &= ~(ICANON | ISIG | ECHO);
|
||||
options.c_lflag &= ~(ICANON | IEXTEN | ISIG | ECHO);
|
||||
|
||||
options.c_iflag &= ~(INLCR | ICRNL);
|
||||
options.c_iflag |= IGNPAR | IGNBRK;
|
||||
|
||||
Reference in New Issue
Block a user