mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #538 from bcostm/master
HAL: NUCLEO_F091RC - pin_mode for Serial only if the pin is presentpull/540/head
commit
8013ae4480
|
@ -168,8 +168,12 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
|
||||||
// Configure the UART pins
|
// Configure the UART pins
|
||||||
pinmap_pinout(tx, PinMap_UART_TX);
|
pinmap_pinout(tx, PinMap_UART_TX);
|
||||||
pinmap_pinout(rx, PinMap_UART_RX);
|
pinmap_pinout(rx, PinMap_UART_RX);
|
||||||
|
if (tx != NC) {
|
||||||
pin_mode(tx, PullUp);
|
pin_mode(tx, PullUp);
|
||||||
|
}
|
||||||
|
if (rx != NC) {
|
||||||
pin_mode(rx, PullUp);
|
pin_mode(rx, PullUp);
|
||||||
|
}
|
||||||
|
|
||||||
// Configure UART
|
// Configure UART
|
||||||
obj->baudrate = 9600;
|
obj->baudrate = 9600;
|
||||||
|
|
Loading…
Reference in New Issue