Skip to content

Commit 96a1c1a

Browse files
LPC55S69: fix serial_set_flow_control
1 parent 419556b commit 96a1c1a

File tree

1 file changed

+8
-4
lines changed
  • targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC

1 file changed

+8
-4
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,10 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
398398

399399
case FlowControlCTS:
400400
/* Do not use RTS, configure pin to GPIO input */
401-
gpio_init(&gpio, rxflow);
402-
gpio_dir(&gpio, PIN_INPUT);
401+
if (rxflow != NC) {
402+
gpio_init(&gpio, rxflow);
403+
gpio_dir(&gpio, PIN_INPUT);
404+
}
403405

404406
pinmap_pinout(txflow, PinMap_UART_CTS);
405407
uart_addrs[obj->index]->CFG |= USART_CFG_CTSEN_MASK;
@@ -413,8 +415,10 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
413415

414416
case FlowControlNone:
415417
/* Do not use RTS, configure pin to GPIO input */
416-
gpio_init(&gpio, rxflow);
417-
gpio_dir(&gpio, PIN_INPUT);
418+
if (rxflow != NC) {
419+
gpio_init(&gpio, rxflow);
420+
gpio_dir(&gpio, PIN_INPUT);
421+
}
418422

419423
uart_addrs[obj->index]->CFG &= ~USART_CFG_CTSEN_MASK;
420424
break;

0 commit comments

Comments
 (0)