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:
Matthijs Kooijman 2013-06-04 10:58:56 +02:00
parent 4d3ccb4118
commit 9b291b8768
1 changed files with 3 additions and 0 deletions

View File

@ -178,6 +178,9 @@ inline void SoftwareSerial::tunedDelay(uint16_t delay) {
// one and returns true if it replaces another
bool SoftwareSerial::listen()
{
if (!_rx_delay_stopbit)
return false;
if (active_object != this)
{
_buffer_overflow = false;