From 6685aa999cf828a994cd81fac78b077a9692d654 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 13 Jun 2013 10:26:15 +0200 Subject: [PATCH] Use stopListening() in SoftwareSerial::end() stopListening also disabled the interrupt, if needed, so calling that function makes more sense. Since stopListening only disables the interrupt when the current SoftwareSerial is the active object, and that can only be the case when _rx_delay_stopbit is non-zero, there is no need to separately check _rx_delay_stopbit anymore. --- .../arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp b/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp index b98451f9e..0e70cb7fd 100644 --- a/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp +++ b/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp @@ -442,8 +442,7 @@ void SoftwareSerial::setRxIntMsk(bool enable) void SoftwareSerial::end() { - if (_rx_delay_stopbit) - setRxIntMsk(false); + stopListening(); }