Skip to content

Commit 8013ae4

Browse files
committed
Merge pull request #538 from bcostm/master
HAL: NUCLEO_F091RC - pin_mode for Serial only if the pin is present
2 parents 46e3704 + 7a32e53 commit 8013ae4

File tree

1 file changed

+6
-2
lines changed
  • libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F091RC

1 file changed

+6
-2
lines changed

libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F091RC/serial_api.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,12 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
168168
// Configure the UART pins
169169
pinmap_pinout(tx, PinMap_UART_TX);
170170
pinmap_pinout(rx, PinMap_UART_RX);
171-
pin_mode(tx, PullUp);
172-
pin_mode(rx, PullUp);
171+
if (tx != NC) {
172+
pin_mode(tx, PullUp);
173+
}
174+
if (rx != NC) {
175+
pin_mode(rx, PullUp);
176+
}
173177

174178
// Configure UART
175179
obj->baudrate = 9600;

0 commit comments

Comments
 (0)