From 6b30e02121a9852c98ba0c7600e041da24b2c1fd Mon Sep 17 00:00:00 2001 From: Andrzej Kuros Date: Fri, 6 Oct 2023 08:41:49 +0200 Subject: [PATCH] [nrf fromlist] nrf53: fix RTC pretick power usage for events on RTC0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For RTC0 events the RTC1 pretick event was not cleared what caused the WDT to be not stopped. This resulted in increased power usage. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/63597 Signed-off-by: Andrzej KuroĊ› --- soc/arm/nordic_nrf/nrf53/soc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/soc/arm/nordic_nrf/nrf53/soc.c b/soc/arm/nordic_nrf/nrf53/soc.c index aa93dfd4b54..c18228ac4fa 100644 --- a/soc/arm/nordic_nrf/nrf53/soc.c +++ b/soc/arm/nordic_nrf/nrf53/soc.c @@ -410,6 +410,8 @@ static void rtc_pretick_rtc_isr_hook(void) { NRF_IPC->PUBLISH_RECEIVE[CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_TO_NET] &= ~IPC_PUBLISH_RECEIVE_EN_Msk; + + nrf_rtc_event_clear(NRF_RTC1, NRF_RTC_CHANNEL_EVENT_ADDR(RTC1_PRETICK_CC_CHAN)); } void rtc_pretick_rtc0_isr_hook(void) @@ -420,10 +422,6 @@ void rtc_pretick_rtc0_isr_hook(void) void rtc_pretick_rtc1_isr_hook(void) { rtc_pretick_rtc_isr_hook(); - - if (IS_ENABLED(CONFIG_SOC_NRF53_RTC_PRETICK)) { - nrf_rtc_event_clear(NRF_RTC1, NRF_RTC_CHANNEL_EVENT_ADDR(RTC1_PRETICK_CC_CHAN)); - } } static int rtc_pretick_cpunet_init(void)