Skip to content

Commit 2e3ae48

Browse files
authored
feat(uart) : Refactor serial inversion methods to return bool
Changed setRxInvert, setTxInvert to return bool. Added setCtsInvert and setRtsInvert methods.
1 parent 4e94855 commit 2e3ae48

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

cores/esp32/HardwareSerial.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,12 +574,20 @@ HardwareSerial::operator bool() const {
574574
return uartIsDriverInstalled(_uart);
575575
}
576576

577-
void HardwareSerial::setRxInvert(bool invert) {
578-
uartSetRxInvert(_uart, invert);
577+
bool HardwareSerial::setRxInvert(bool invert) {
578+
return uartSetRxInvert(_uart, invert);
579579
}
580580

581-
void HardwareSerial::setTxInvert(bool invert) {
582-
uartSetTxInvert(_uart, invert);
581+
bool HardwareSerial::setTxInvert(bool invert) {
582+
return uartSetTxInvert(_uart, invert);
583+
}
584+
585+
bool HardwareSerial::setCtsInvert(bool invert) {
586+
return uartSetCtsInvert(_uart, invert);
587+
}
588+
589+
bool HardwareSerial::setRtsInvert(bool invert) {
590+
return uartSetRtsInvert(_uart, invert);
583591
}
584592

585593
// negative Pin value will keep it unmodified

0 commit comments

Comments
 (0)