Merge pull request #538 from bcostm/master

HAL: NUCLEO_F091RC - pin_mode for Serial only if the pin is present
pull/540/head
Martin Kojtal 2014-10-08 08:24:56 +01:00
commit 8013ae4480
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;