mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-21 15:54:39 +01:00
Let SoftwareSerial::listen() fail on invalid rx baud rates
In this case, SoftwareSerial::begin will not have enabled the interrupts, so better not allow the SoftwareSerial instance to enter the listening state either.
This commit is contained in:
parent
937cc51c69
commit
b1c7a3d05f
@ -178,6 +178,9 @@ inline void SoftwareSerial::tunedDelay(uint16_t delay) {
|
|||||||
// one and returns true if it replaces another
|
// one and returns true if it replaces another
|
||||||
bool SoftwareSerial::listen()
|
bool SoftwareSerial::listen()
|
||||||
{
|
{
|
||||||
|
if (!_rx_delay_stopbit)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (active_object != this)
|
if (active_object != this)
|
||||||
{
|
{
|
||||||
_buffer_overflow = false;
|
_buffer_overflow = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user