helpfor studient
Dependents: STM32_F103-C8T6basecanblink_led
Fork of mbed-dev by
Diff: targets/TARGET_NORDIC/TARGET_NRF5/lp_ticker.c
- Revision:
- 183:a56a73fd2a6f
- Parent:
- 174:b96e65c34a4d
--- a/targets/TARGET_NORDIC/TARGET_NRF5/lp_ticker.c Fri Feb 16 16:09:33 2018 +0000 +++ b/targets/TARGET_NORDIC/TARGET_NRF5/lp_ticker.c Tue Mar 20 16:56:18 2018 +0000 @@ -18,6 +18,7 @@ #if DEVICE_LOWPOWERTIMER #include "common_rtc.h" +#include "mbed_critical.h" void lp_ticker_init(void) { @@ -37,10 +38,10 @@ void lp_ticker_fire_interrupt(void) { - uint32_t closest_safe_compare = common_rtc_32bit_ticks_get() + 2; - - nrf_rtc_cc_set(COMMON_RTC_INSTANCE, LP_TICKER_CC_CHANNEL, RTC_WRAP(closest_safe_compare)); - nrf_rtc_event_enable(COMMON_RTC_INSTANCE, LP_TICKER_INT_MASK); + core_util_critical_section_enter(); + m_common_sw_irq_flag |= LP_TICKER_SW_IRQ_MASK; + NVIC_SetPendingIRQ(RTC1_IRQn); + core_util_critical_section_exit(); } void lp_ticker_disable_interrupt(void)