[NUCLEO_F091RC] pin_mode for Serial only if the pin is present

Same as all other targets.
pull/538/head
bcostm 2014-10-08 08:50:05 +02:00
parent 46e37048a8
commit 7a32e539fb
1 changed files with 6 additions and 2 deletions

View File

@ -168,8 +168,12 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
// Configure the UART pins
pinmap_pinout(tx, PinMap_UART_TX);
pinmap_pinout(rx, PinMap_UART_RX);
pin_mode(tx, PullUp);
pin_mode(rx, PullUp);
if (tx != NC) {
pin_mode(tx, PullUp);
}
if (rx != NC) {
pin_mode(rx, PullUp);
}
// Configure UART
obj->baudrate = 9600;