Disable all NRF52 serial interrupts on init

When initializing serial disable all interrupts as some of these may
have been enabled by a bootloader. This ensures that the NRF52
serial driver remains compatible with any bootloader version.
pull/8784/head
Russ Butler 2018-11-21 14:37:20 -06:00
parent 9ce3965ae2
commit 4acdf7012c
1 changed files with 2 additions and 4 deletions

View File

@ -882,8 +882,7 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
nordic_nrf5_uart_state[0].rts = NRF_UART_PSEL_DISCONNECTED;
/* Clear any old events and enable interrupts for UARTE0. */
nrf_uarte_int_disable(nordic_nrf5_uart_register[0], NRF_UARTE_INT_RXSTARTED_MASK |
NRF_UARTE_INT_ENDRX_MASK);
nrf_uarte_int_disable(nordic_nrf5_uart_register[0], 0xFFFFFFFF);
NVIC_SetVector(UARTE0_UART0_IRQn, (uint32_t) nordic_nrf5_uart0_handler);
nrf_drv_common_irq_enable(UARTE0_UART0_IRQn, APP_IRQ_PRIORITY_HIGHEST);
@ -904,8 +903,7 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
nordic_nrf5_uart_state[1].rts = NRF_UART_PSEL_DISCONNECTED;
/* Clear any old events and enable interrupts for UARTE1. */
nrf_uarte_int_disable(nordic_nrf5_uart_register[1], NRF_UARTE_INT_RXSTARTED_MASK |
NRF_UARTE_INT_ENDRX_MASK);
nrf_uarte_int_disable(nordic_nrf5_uart_register[1], 0xFFFFFFFF);
NVIC_SetVector(UARTE1_IRQn, (uint32_t) nordic_nrf5_uart1_handler);
nrf_drv_common_irq_enable(UARTE1_IRQn, APP_IRQ_PRIORITY_HIGHEST);