Skip to content

Commit 9554c1d

Browse files
committed
Reverted begin(long speed) to its original prototype (i.e.
returning void)
1 parent 369aeee commit 9554c1d

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

libraries/SoftwareSerial/SoftwareSerial.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,13 @@ void SoftwareSerial::setRX(uint8_t rx)
376376
// Public methods
377377
//
378378

379-
bool SoftwareSerial::begin(long speed)
379+
void SoftwareSerial::begin(long speed)
380380
{
381381
_rx_delay_centering = _rx_delay_intrabit = _rx_delay_stopbit = _tx_delay = 0;
382382

383-
long baud = 0;
384-
385383
for (unsigned i=0; i<sizeof(table)/sizeof(table[0]); ++i)
386384
{
387-
baud = pgm_read_dword(&table[i].baud);
385+
long baud = pgm_read_dword(&table[i].baud);
388386
if (baud == speed)
389387
{
390388
_rx_delay_centering = pgm_read_word(&table[i].rx_delay_centering);
@@ -394,7 +392,6 @@ bool SoftwareSerial::begin(long speed)
394392
break;
395393
}
396394
}
397-
if (baud != speed) return false;
398395

399396
// Set up RX interrupts, but only if we have a valid RX baud rate
400397
if (_rx_delay_stopbit)
@@ -413,8 +410,6 @@ bool SoftwareSerial::begin(long speed)
413410
#endif
414411

415412
listen();
416-
417-
return true;
418413
}
419414

420415
void SoftwareSerial::end()

libraries/SoftwareSerial/SoftwareSerial.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class SoftwareSerial : public Stream
8282
// public methods
8383
SoftwareSerial(uint8_t receivePin, uint8_t transmitPin, bool inverse_logic = false);
8484
~SoftwareSerial();
85-
bool begin(long speed);
85+
void begin(long speed);
8686
bool listen();
8787
void end();
8888
bool isListening() { return this == active_object; }

0 commit comments

Comments
 (0)