Skip to content

Commit

Permalink
[msom] Fix unintentional pin changes for Serial1 RTS/CTS
Browse files Browse the repository at this point in the history
  • Loading branch information
eberseth committed Oct 3, 2023
1 parent a6fd0a0 commit 12a3ee4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hal/src/rtl872x/usart_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ class Usart {
PAD_PullCtrl(hal_pin_to_rtl_pin(txPin_), GPIO_PuPd_NOPULL);
PAD_PullCtrl(hal_pin_to_rtl_pin(rxPin_), GPIO_PuPd_NOPULL);
// Configure CTS/RTS pins
if (ctsPin_ != PIN_INVALID) {
if (ctsPin_ != PIN_INVALID && (conf.config & SERIAL_FLOW_CONTROL_CTS)) {
Pinmux_Config(hal_pin_to_rtl_pin(ctsPin_), PINMUX_FUNCTION_UART_RTSCTS);
PAD_PullCtrl(hal_pin_to_rtl_pin(ctsPin_), GPIO_PuPd_UP);
}
if (rtsPin_ != PIN_INVALID) {
if (rtsPin_ != PIN_INVALID && (conf.config & SERIAL_FLOW_CONTROL_RTS)) {
Pinmux_Config(hal_pin_to_rtl_pin(rtsPin_), PINMUX_FUNCTION_UART_RTSCTS);
PAD_PullCtrl(hal_pin_to_rtl_pin(rtsPin_), GPIO_PuPd_UP);
}
Expand Down Expand Up @@ -647,10 +647,10 @@ class Usart {
// Do not change the pull ability to not mess up the peer device.
Pinmux_Config(hal_pin_to_rtl_pin(txPin_), PINMUX_FUNCTION_GPIO);
Pinmux_Config(hal_pin_to_rtl_pin(rxPin_), PINMUX_FUNCTION_GPIO);
if (ctsPin_ != PIN_INVALID) {
if (ctsPin_ != PIN_INVALID && (config_.config & SERIAL_FLOW_CONTROL_CTS)) {
Pinmux_Config(hal_pin_to_rtl_pin(ctsPin_), PINMUX_FUNCTION_GPIO);
}
if (rtsPin_ != PIN_INVALID) {
if (rtsPin_ != PIN_INVALID && (config_.config & SERIAL_FLOW_CONTROL_RTS)) {
Pinmux_Config(hal_pin_to_rtl_pin(rtsPin_), PINMUX_FUNCTION_GPIO);
}

Expand Down

0 comments on commit 12a3ee4

Please sign in to comment.