File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
libraries/SoftwareSerial/src Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -227,15 +227,15 @@ inline void SoftwareSerial::send()
227227 tx_tick_cnt = OVERSAMPLE; // Wait OVERSAMPLE tick to send next bit
228228 } else { // Transmission finished
229229 tx_tick_cnt = 1 ;
230- if (_output_pending || !(_half_duplex && active_listener == this ) ) {
230+ if (_output_pending) {
231231 active_out = nullptr ;
232- rx_bit_cnt = -1 ; // rx_bit_cnt = -1 : waiting for start bit
233- rx_tick_cnt = 2 ; // 2 : next interrupt will be discarded. 2 interrupts required to consider RX pin level
234- active_in = this ;
235- // When in half-duplex mode, we wait for HALFDUPLEX_SWITCH_DELAY bit-periods after the byte has
232+
233+ // When in half-duplex mode, wait for HALFDUPLEX_SWITCH_DELAY bit-periods after the byte has
236234 // been transmitted before allowing the switch to RX mode
237235 } else if (tx_bit_cnt > 10 + OVERSAMPLE * HALFDUPLEX_SWITCH_DELAY) {
238- pinMode (_receivePin, _inverse_logic ? INPUT_PULLDOWN : INPUT_PULLUP); // pullup for normal logic!
236+ if (_half_duplex && active_listener == this ) {
237+ setRXTX (true );
238+ }
239239 active_out = nullptr ;
240240 }
241241 }
@@ -348,11 +348,10 @@ void SoftwareSerial::begin(long speed)
348348 if (!_half_duplex) {
349349 setTX ();
350350 setRX ();
351+ listen ();
351352 } else {
352353 setTX ();
353354 }
354-
355- listen ();
356355}
357356
358357void SoftwareSerial::end ()
You can’t perform that action at this time.
0 commit comments