mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-29 10:24:12 +01:00
Reverted begin(long speed) to its original prototype (i.e.
returning void)
This commit is contained in:
parent
369aeeef51
commit
9554c1d3cd
@ -376,15 +376,13 @@ void SoftwareSerial::setRX(uint8_t rx)
|
||||
// Public methods
|
||||
//
|
||||
|
||||
bool SoftwareSerial::begin(long speed)
|
||||
void SoftwareSerial::begin(long speed)
|
||||
{
|
||||
_rx_delay_centering = _rx_delay_intrabit = _rx_delay_stopbit = _tx_delay = 0;
|
||||
|
||||
long baud = 0;
|
||||
|
||||
for (unsigned i=0; i<sizeof(table)/sizeof(table[0]); ++i)
|
||||
{
|
||||
baud = pgm_read_dword(&table[i].baud);
|
||||
long baud = pgm_read_dword(&table[i].baud);
|
||||
if (baud == speed)
|
||||
{
|
||||
_rx_delay_centering = pgm_read_word(&table[i].rx_delay_centering);
|
||||
@ -394,7 +392,6 @@ bool SoftwareSerial::begin(long speed)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (baud != speed) return false;
|
||||
|
||||
// Set up RX interrupts, but only if we have a valid RX baud rate
|
||||
if (_rx_delay_stopbit)
|
||||
@ -413,8 +410,6 @@ bool SoftwareSerial::begin(long speed)
|
||||
#endif
|
||||
|
||||
listen();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SoftwareSerial::end()
|
||||
|
@ -82,7 +82,7 @@ public:
|
||||
// public methods
|
||||
SoftwareSerial(uint8_t receivePin, uint8_t transmitPin, bool inverse_logic = false);
|
||||
~SoftwareSerial();
|
||||
bool begin(long speed);
|
||||
void begin(long speed);
|
||||
bool listen();
|
||||
void end();
|
||||
bool isListening() { return this == active_object; }
|
||||
|
Loading…
Reference in New Issue
Block a user