Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e6a5b68

Browse filesBrowse files
ewasscherme-no-dev
authored andcommitted
Added argument to HardwareSerial.begin to specify whether the logic levels of the UART rx and tx lines should be inverted (espressif#719)
1 parent cabc4c5 commit e6a5b68
Copy full SHA for e6a5b68

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed

‎cores/esp32/HardwareSerial.cpp

Copy file name to clipboardExpand all lines: cores/esp32/HardwareSerial.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ HardwareSerial Serial(0);
99

1010
HardwareSerial::HardwareSerial(int uart_nr) : _uart_nr(uart_nr), _uart(NULL) {}
1111

12-
void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin)
12+
void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
1313
{
1414
if(0 > _uart_nr || _uart_nr > 2) {
1515
log_e("Serial number is invalid, please use 0, 1 or 2");
@@ -30,7 +30,7 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in
3030
rxPin = 16;
3131
txPin = 17;
3232
}
33-
_uart = uartBegin(_uart_nr, baud, config, rxPin, txPin, 256, false);
33+
_uart = uartBegin(_uart_nr, baud, config, rxPin, txPin, 256, invert);
3434
}
3535

3636
void HardwareSerial::end()

‎cores/esp32/HardwareSerial.h

Copy file name to clipboardExpand all lines: cores/esp32/HardwareSerial.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class HardwareSerial: public Stream
3737
public:
3838
HardwareSerial(int uart_nr);
3939

40-
void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1);
40+
void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false);
4141
void end();
4242
int available(void);
4343
int peek(void);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.