mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Fix idle level when initializing a inverted SoftwareSerial
Previously, when SoftwareSerial was initialized, it would always be set to an idle level of HIGH, even when inverted logic was enabled. Once a byte is transmitted, the idle level gets correctly set to LOW instead. This commit makes sure that the idle level is correct directly after initialization already. This fixes #1361.
This commit is contained in:
@ -355,7 +355,7 @@ SoftwareSerial::~SoftwareSerial()
|
||||
void SoftwareSerial::setTX(uint8_t tx)
|
||||
{
|
||||
pinMode(tx, OUTPUT);
|
||||
digitalWrite(tx, HIGH);
|
||||
digitalWrite(tx, _inverse_logic ? LOW : HIGH);
|
||||
_transmitBitMask = digitalPinToBitMask(tx);
|
||||
uint8_t port = digitalPinToPort(tx);
|
||||
_transmitPortRegister = portOutputRegister(port);
|
||||
|
Reference in New Issue
Block a user