Skip to content

Commit cf0cc48

Browse files
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.
1 parent 11ade32 commit cf0cc48

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libraries/SoftwareSerial/SoftwareSerial.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,7 @@ void SoftwareSerial::setRxIntMsk(bool enable)
442442

443443
void SoftwareSerial::end()
444444
{
445-
if (_rx_delay_stopbit)
446-
setRxIntMsk(false);
445+
stopListening();
447446
}
448447

449448

0 commit comments

Comments
 (0)