From 7bd71f04b0ad70ffb8470fb77052b7f4e0d5b91f Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 11 Nov 2015 16:28:48 +0100 Subject: SoftwareSerial: fix flush() behaviour Fix #4029 --- libraries/SoftwareSerial/SoftwareSerial.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'libraries/SoftwareSerial') diff --git a/libraries/SoftwareSerial/SoftwareSerial.cpp b/libraries/SoftwareSerial/SoftwareSerial.cpp index 80df664..0a16ff7 100644 --- a/libraries/SoftwareSerial/SoftwareSerial.cpp +++ b/libraries/SoftwareSerial/SoftwareSerial.cpp @@ -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() -- cgit v1.2.3-18-g5258