NRF52: serial: fix build warnings

pull/10652/head
Naveen Kaje 2018-12-07 10:16:30 -06:00 committed by desmond.chen
parent e9a3ca6259
commit 8eaf87cd50
1 changed files with 6 additions and 5 deletions

View File

@ -672,12 +672,12 @@ static void nordic_nrf5_uart_configure_object(serial_t *obj)
/* Enable flow control and parity. */
nrf_uarte_configure(nordic_nrf5_uart_register[uart_object->instance],
uart_object->parity,
uart_object->hwfc);
(nrf_uarte_parity_t) uart_object->parity,
(nrf_uarte_hwfc_t) uart_object->hwfc);
/* Set baudrate. */
nrf_uarte_baudrate_set(nordic_nrf5_uart_register[uart_object->instance],
uart_object->baudrate);
(nrf_uarte_baudrate_t) uart_object->baudrate);
}
/**
@ -940,7 +940,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
/* Wait until NRF_UARTE_EVENT_TXDRDY is set before proceeding. */
bool done = false;
do {
done = nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_TXDRDY);
done = nrf_uarte_event_check(nordic_nrf5_uart_register[instance],
(nrf_uarte_event_t) NRF_UARTE_EVENT_TXDRDY);
} while(done == false);
}
@ -1025,7 +1026,7 @@ void serial_baud(serial_t *obj, int baudrate)
struct serial_s *uart_object = obj;
#endif
nrf_uart_baudrate_t new_rate = NRF_UART_BAUDRATE_9600;
nrf_uarte_baudrate_t new_rate = NRF_UART_BAUDRATE_9600;
/* Round down to nearest supported baud rate. */
if (baudrate < 2400) {