mirror of https://github.com/ARMmbed/mbed-os.git
serial_api: Fix the interrupt registration for Nordic Serial Device
Using the nrfx_get_irq_number only works with the handle. Since we know the IRQ numbers for UART0, RTC2 and EGU0, use them directly.pull/10652/head
parent
52c6048dc8
commit
8123b5128d
|
|
@ -860,8 +860,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
|
||||||
NRF_RTC_INT_COMPARE1_MASK);
|
NRF_RTC_INT_COMPARE1_MASK);
|
||||||
|
|
||||||
/* Enable RTC2 IRQ. Priority is set to highest so that the UARTE ISR can't interrupt it. */
|
/* Enable RTC2 IRQ. Priority is set to highest so that the UARTE ISR can't interrupt it. */
|
||||||
NRFX_IRQ_PRIORITY_SET(nrfx_get_irq_number((void const*)RTC2_IRQn), APP_IRQ_PRIORITY_HIGHEST);
|
NRFX_IRQ_PRIORITY_SET(RTC2_IRQn, APP_IRQ_PRIORITY_HIGHEST);
|
||||||
NRFX_IRQ_ENABLE(nrfx_get_irq_number((void const*)RTC2_IRQn));
|
NRFX_IRQ_ENABLE(RTC2_IRQn);
|
||||||
|
|
||||||
|
|
||||||
/* Start RTC2. According to the datasheet the added power consumption is neglible so
|
/* Start RTC2. According to the datasheet the added power consumption is neglible so
|
||||||
|
|
@ -871,8 +871,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
|
||||||
|
|
||||||
/* Enable interrupts for SWI. */
|
/* Enable interrupts for SWI. */
|
||||||
NVIC_SetVector(SWI0_EGU0_IRQn, (uint32_t) nordic_nrf5_uart_swi0);
|
NVIC_SetVector(SWI0_EGU0_IRQn, (uint32_t) nordic_nrf5_uart_swi0);
|
||||||
NRFX_IRQ_PRIORITY_SET(nrfx_get_irq_number((void const*)SWI0_EGU0_IRQn), APP_IRQ_PRIORITY_LOWEST);
|
NRFX_IRQ_PRIORITY_SET(SWI0_EGU0_IRQn, APP_IRQ_PRIORITY_LOWEST);
|
||||||
NRFX_IRQ_ENABLE(nrfx_get_irq_number((void const*)SWI0_EGU0_IRQn));
|
NRFX_IRQ_ENABLE(SWI0_EGU0_IRQn);
|
||||||
|
|
||||||
/* Initialize FIFO buffer for UARTE0. */
|
/* Initialize FIFO buffer for UARTE0. */
|
||||||
NRF_ATFIFO_INIT(nordic_nrf5_uart_fifo_0);
|
NRF_ATFIFO_INIT(nordic_nrf5_uart_fifo_0);
|
||||||
|
|
@ -892,8 +892,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
|
||||||
nrf_uarte_int_disable(nordic_nrf5_uart_register[0], 0xFFFFFFFF);
|
nrf_uarte_int_disable(nordic_nrf5_uart_register[0], 0xFFFFFFFF);
|
||||||
|
|
||||||
NVIC_SetVector(UARTE0_UART0_IRQn, (uint32_t) nordic_nrf5_uart0_handler);
|
NVIC_SetVector(UARTE0_UART0_IRQn, (uint32_t) nordic_nrf5_uart0_handler);
|
||||||
NRFX_IRQ_PRIORITY_SET(nrfx_get_irq_number((void const*)UARTE0_UART0_IRQn), APP_IRQ_PRIORITY_HIGHEST);
|
NRFX_IRQ_PRIORITY_SET(UARTE0_UART0_IRQn, APP_IRQ_PRIORITY_HIGHEST);
|
||||||
NRFX_IRQ_ENABLE(nrfx_get_irq_number((void const*)UARTE0_UART0_IRQn));
|
NRFX_IRQ_ENABLE(UARTE0_UART0_IRQn);
|
||||||
|
|
||||||
#if UART1_ENABLED
|
#if UART1_ENABLED
|
||||||
/* Initialize FIFO buffer for UARTE1. */
|
/* Initialize FIFO buffer for UARTE1. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue