Merge pull request #12006 from jamesbeyond/fc_fix

FIX: fix a bug introduced by static pinmap
pull/12022/head
Martin Kojtal 2019-12-03 13:20:14 +01:00 committed by GitHub
commit c098bdff18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -424,8 +424,10 @@ static void _serial_set_flow_control_direct(serial_t *obj, FlowControl type, con
case FlowControlCTS:
/* Do not use RTS, configure pin to GPIO input */
if (pinmap->rx_flow_pin != NC) {
gpio_init(&gpio, pinmap->rx_flow_pin);
gpio_dir(&gpio, PIN_INPUT);
}
pin_function(pinmap->tx_flow_pin, pinmap->tx_flow_function);
pin_mode(pinmap->tx_flow_pin, PullNone);
@ -442,8 +444,10 @@ static void _serial_set_flow_control_direct(serial_t *obj, FlowControl type, con
case FlowControlNone:
/* Do not use RTS, configure pin to GPIO input */
if (pinmap->rx_flow_pin != NC) {
gpio_init(&gpio, pinmap->rx_flow_pin);
gpio_dir(&gpio, PIN_INPUT);
}
uart_addrs[obj->index]->CFG &= ~USART_CFG_CTSEN_MASK;
break;