1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

SoftwareSerial: fix flush() behaviour

Fix #4029
This commit is contained in:
Cristian Maglie 2015-11-11 16:28:48 +01:00
parent 375146cd91
commit 934475b75b

View File

@ -469,13 +469,7 @@ size_t SoftwareSerial::write(uint8_t b)
void SoftwareSerial::flush()
{
if (!isListening())
return;
uint8_t oldSREG = SREG;
cli();
_receive_buffer_head = _receive_buffer_tail = 0;
SREG = oldSREG;
// There is no tx buffering, simply return
}
int SoftwareSerial::peek()