Skip to content

Commit f63fb2a

Browse files
pan-adbridge
authored andcommitted
Fix a bug related to the RTC interrupt enabled.
Enable the interrupt for the OS tick when the OS tick is enabled rather than all the time. Otherwise, the interrupt will be triggered bu never handled.
1 parent 2430dea commit f63fb2a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

targets/TARGET_NORDIC/TARGET_NRF5/us_ticker.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ void common_rtc_init(void)
110110
// events will be enabled or disabled as needed (such approach is more
111111
// energy efficient).
112112
nrf_rtc_int_enable(COMMON_RTC_INSTANCE,
113-
#if defined(TARGET_MCU_NRF51822)
114-
OS_TICK_INT_MASK |
115-
#endif
116113
#if DEVICE_LOWPOWERTIMER
117114
LP_TICKER_INT_MASK |
118115
#endif
@@ -506,6 +503,7 @@ static void register_next_tick() {
506503
int os_tick_init (void)
507504
{
508505
common_rtc_init();
506+
nrf_rtc_int_enable(COMMON_RTC_INSTANCE, OS_TICK_INT_MASK);
509507

510508
nrf_rtc_cc_set(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL, 0);
511509
register_next_tick();

0 commit comments

Comments
 (0)