Allow STDIO pins to be NC in NRF52 series

Prevent ASSERT from triggering when one of the STDIO pins is not
connected.
pull/7487/head
Marcus Chang 2018-07-11 17:19:18 -07:00
parent f4382d95b8
commit fd088d2c4e
1 changed files with 10 additions and 3 deletions

View File

@ -789,9 +789,16 @@ static void nordic_nrf5_uart_configure_object(serial_t *obj)
#endif #endif
/* Configure Tx and Rx pins. */ /* Configure Tx and Rx pins. */
nrf_gpio_pin_set(uart_object->tx); if (uart_object->tx != NRF_UART_PSEL_DISCONNECTED) {
nrf_gpio_cfg_output(uart_object->tx);
nrf_gpio_cfg_input(uart_object->rx, NRF_GPIO_PIN_NOPULL); nrf_gpio_pin_set(uart_object->tx);
nrf_gpio_cfg_output(uart_object->tx);
}
if (uart_object->rx != NRF_UART_PSEL_DISCONNECTED) {
nrf_gpio_cfg_input(uart_object->rx, NRF_GPIO_PIN_NOPULL);
}
nrf_uarte_txrx_pins_set(nordic_nrf5_uart_register[uart_object->instance], nrf_uarte_txrx_pins_set(nordic_nrf5_uart_register[uart_object->instance],
uart_object->tx, uart_object->tx,