From 1d1df9e1725928b6a7a04aa715e12dc67068e93a Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Wed, 22 Mar 2017 13:15:11 +0100 Subject: [PATCH] use core_util_critical_section_enter/exit instead of __enable_irq/__disable_irq --- targets/TARGET_NORDIC/TARGET_NRF5_SDK13/us_ticker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/us_ticker.c b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/us_ticker.c index ebc79dcea3..1ef96f5438 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/us_ticker.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5_SDK13/us_ticker.c @@ -41,6 +41,7 @@ #include "app_util.h" #include "nrf_drv_common.h" #include "lp_ticker_api.h" +#include "mbed_critical.h" #if defined(NRF52_ERRATA_20) #include "softdevice_handler.h" @@ -531,7 +532,7 @@ static void register_next_tick() // the RTC1 keeps running. // This code is very short 20-38 cycles in the worst case, it shouldn't // disturb softdevice. - __disable_irq(); + core_util_critical_section_enter(); uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE); // If an overflow occur, set the next tick in COUNTER + delta clock cycles @@ -543,7 +544,7 @@ static void register_next_tick() // Enable generation of the compare event for the value set above (this // event will trigger the interrupt). nrf_rtc_event_enable(COMMON_RTC_INSTANCE, OS_TICK_INT_MASK); - __enable_irq(); + core_util_critical_section_exit(); } /**