Fix glitch when initializing NRF51-DK serial port

When initializing the NRF51's serial TX and RTS pins set the
data output register to high before setting the setting them to
output.  This prevents these pins from glitching low before
the UART has been turned on.
pull/1472/head
Russ 2015-12-13 01:27:01 -06:00
parent 09970394da
commit 5c75dc29ee
1 changed files with 2 additions and 0 deletions

View File

@ -58,6 +58,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
obj->uart = (NRF_UART_Type *)uart; obj->uart = (NRF_UART_Type *)uart;
//pin configurations -- //pin configurations --
NRF_GPIO->OUT |= (1 << tx);
NRF_GPIO->OUT |= (1 << RTS_PIN_NUMBER);
NRF_GPIO->DIR |= (1 << tx); //TX_PIN_NUMBER); NRF_GPIO->DIR |= (1 << tx); //TX_PIN_NUMBER);
NRF_GPIO->DIR |= (1 << RTS_PIN_NUMBER); NRF_GPIO->DIR |= (1 << RTS_PIN_NUMBER);