Skip to content

Commit c794c47

Browse files
committed
SoftwareSerial regression fix
-set pinMode for RX and TX pins inside of begin instead of the constructor
1 parent 6d3c39d commit c794c47

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libraries/CurieSoftwareSerial/src/SoftwareSerial.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,7 @@ SoftwareSerial::SoftwareSerial(uint32_t receivePin, uint32_t transmitPin, bool i
226226
_inverse_logic(inverse_logic)
227227
{
228228
_inverse_logic = inverse_logic;
229-
setTX(transmitPin);
230229
_transmitPin = transmitPin;
231-
setRX(receivePin);
232230
_receivePin = receivePin;
233231
_receive_buffer = (char*)dccm_malloc(_SS_MAX_RX_BUFF);
234232
}
@@ -272,6 +270,9 @@ uint16_t SoftwareSerial::subtract_cap(uint16_t num, uint16_t sub) {
272270

273271
void SoftwareSerial::begin(long speed)
274272
{
273+
setTX(_transmitPin);
274+
setRX(_receivePin);
275+
275276
_rx_delay_centering = _rx_delay_intrabit = _rx_delay_stopbit = _tx_delay = 0;
276277
//pre-calculate delays
277278
_bit_delay = (F_CPU/speed);

0 commit comments

Comments
 (0)