Skip to content

Commit b073720

Browse files
committed
NRF5x: Increase lp us ticker interrupt priority
Set the second highest user level, leaving the highest for UART (we are having constant overflows) and two levels below for everything else. This should increase the timer accuracy.
1 parent 7e222f2 commit b073720

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/common_rtc.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,7 @@ void common_rtc_init(void)
173173
nrf_rtc_int_disable(COMMON_RTC_INSTANCE, LP_TICKER_INT_MASK);
174174
#endif
175175

176-
nrf_drv_common_irq_enable(nrf_drv_get_IRQn(COMMON_RTC_INSTANCE),
177-
#ifdef NRF51
178-
APP_IRQ_PRIORITY_LOW
179-
#elif defined(NRF52) || defined(NRF52840_XXAA)
180-
APP_IRQ_PRIORITY_LOWEST
181-
#endif
182-
);
176+
nrf_drv_common_irq_enable(nrf_drv_get_IRQn(COMMON_RTC_INSTANCE), APP_IRQ_PRIORITY_HIGH);
183177

184178
nrf_rtc_task_trigger(COMMON_RTC_INSTANCE, NRF_RTC_TASK_START);
185179

targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,7 @@ void us_ticker_init(void)
8989

9090
NVIC_SetVector(TIMER1_IRQn, (uint32_t)us_ticker_irq_handler);
9191

92-
nrf_drv_common_irq_enable(TIMER1_IRQn,
93-
94-
#ifdef NRF51
95-
APP_IRQ_PRIORITY_LOW
96-
#elif defined(NRF52) || defined(NRF52840_XXAA)
97-
APP_IRQ_PRIORITY_LOWEST
98-
#endif
99-
);
92+
nrf_drv_common_irq_enable(TIMER1_IRQn, APP_IRQ_PRIORITY_HIGH);
10093

10194
nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_START);
10295

0 commit comments

Comments
 (0)