We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03f242b commit b6ba4b6Copy full SHA for b6ba4b6
libraries/SoftwareSerial/SoftwareSerial.cpp
@@ -259,11 +259,12 @@ void SoftwareSerial::recv()
259
d = ~d;
260
261
// if buffer full, set the overflow flag and return
262
- if ((_receive_buffer_tail + 1) % _SS_MAX_RX_BUFF != _receive_buffer_head)
+ uint8_t next = (_receive_buffer_tail + 1) % _SS_MAX_RX_BUFF;
263
+ if (next != _receive_buffer_head)
264
{
265
// save new data in buffer: tail points to where byte goes
266
_receive_buffer[_receive_buffer_tail] = d; // save new byte
- _receive_buffer_tail = (_receive_buffer_tail + 1) % _SS_MAX_RX_BUFF;
267
+ _receive_buffer_tail = next;
268
}
269
else
270
0 commit comments