diff --git a/src/SoftwareSerial9.cpp b/src/SoftwareSerial9.cpp index 1930c8d..78da2cc 100644 --- a/src/SoftwareSerial9.cpp +++ b/src/SoftwareSerial9.cpp @@ -165,7 +165,7 @@ void SoftwareSerial9::recv() } if (_inverse_logic) - d = ~d; + d ^= 511; // toggle using binary mask 111111111 // if buffer full, set the overflow flag and return uint8_t next = (_receive_buffer_tail + 1) % _SS_MAX_RX_BUFF;