Skip to content

Commit 9634116

Browse files
authored
fix(uart): missing uart struct usage
1 parent 3781bef commit 9634116

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cores/esp32/esp32-hal-uart.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -874,17 +874,17 @@ uart_t *uartBegin(
874874
if (retCode) {
875875
if (inverted) {
876876
// invert signal for both Rx and Tx
877-
uint32_t _inv_mask = inv_mask;
877+
uint32_t _inv_mask = uart->inv_mask;
878878
_inv_mask |= UART_SIGNAL_TXD_INV | UART_SIGNAL_RXD_INV;
879879
retCode &= ESP_OK == uart_set_line_inverse(uart_nr, _inv_mask);
880880
if (retCode) {
881-
inv_mask = _inv_mask;
881+
uart->inv_mask = _inv_mask;
882882
}
883883
} else {
884884
// disable invert signal for both Rx and Tx
885885
retCode &= ESP_OK == uart_set_line_inverse(uart_nr, UART_SIGNAL_INV_DISABLE);
886886
if (retCode) {
887-
inv_mask = UART_SIGNAL_INV_DISABLE;
887+
uart->inv_mask = UART_SIGNAL_INV_DISABLE;
888888
}
889889
}
890890
}
@@ -995,15 +995,15 @@ bool uartPinSignalInversion(uart_t *uart, uint32_t invMask, bool inverted) {
995995
return;
996996
}
997997
UART_MUTEX_LOCK();
998-
uint32_t _inv_mask = inv_mask;
998+
uint32_t _inv_mask = uart->inv_mask;
999999
if (inverted) {
10001000
_inv_mask |= invMask;
10011001
} else {
10021002
_inv_mask &= ~invMask;
10031003
}
10041004
bool retCode = ESP_OK == uart_set_line_inverse(uart->num, _inv_mask);
10051005
if (retCode) {
1006-
inv_mask = _inv_mask;
1006+
uart->inv_mask = _inv_mask;
10071007
}
10081008
UART_MUTEX_UNLOCK();
10091009
return retCode;

0 commit comments

Comments
 (0)