8000 Last code formatting fix · timkoers/arduino-esp32@02b29fd · GitHub
[go: up one dir, main page]

Skip to content

Commit 02b29fd

Browse files
committed
Last code formatting fix
1 parent cadb74d commit 02b29fd

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

cores/esp32/esp32-hal-uart.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void uartDisableInterrupt(uart_t* uart)
155155

156156
void uartDetachRx(uart_t* uart, uint8_t rxPin)
157157
{
158-
if(uart == NULL){
158+
if(uart == NULL) {
159159
return;
160160
}
161161
pinMatrixInDetach(rxPin, false, false);
@@ -164,12 +164,22 @@ void uartDetachRx(uart_t* uart, uint8_t rxPin)
164164

165165
void uartDetachTx(uart_t* uart, uint8_t txPin)
166166
{
167-
if(uart == NULL){
167+
if(uart == NULL) {
168168
return;
169169
}
170170
pinMatrixOutDetach(txPin, false, false);
171171
}
172172

173+
void uartAttachRx(uart_t* uart, uint8_t rxPin, bool inverted)
174+
{
175+
if(uart == NULL || rxPin > 39) {
176+
return;
177+
}
178+
pinMode(rxPin, INPUT);
179+
pinMatrixInAttach(rxPin, UART_RXD_IDX(uart->num), inverted);
180+
uartEnableInterrupt(uart);
181+
}
182+
173183
void uartAttachTx(uart_t* uart, uint8_t txPin, bool inverted)
174184
{
175185
if(uart == NULL || txPin > 39) {
@@ -651,4 +661,4 @@ uartDetectBaudrate(uart_t *uart)
651661
*/
652662
bool uartRxActive(uart_t* uart) {
653663
return uart->dev->status.st_urx_out != 0;
654-
}
664+
}

0 commit comments

Comments
 (0)
0