drivers: rtc: stm32: narrow backup domain access window during interrupts
Change backup domain access gating in STM32 RTC interrupt handler to only request access when RTC registers ar to be modified instead of during the whole RTC interrupts service including interrupt consumer callback execution. Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
This commit is contained in:
parent
007d3e3c85
commit
9b022972d8
@ -283,13 +283,13 @@ void rtc_stm32_isr(const struct device *dev)
|
||||
struct rtc_stm32_alrm *p_rtc_alrm;
|
||||
int id = 0;
|
||||
|
||||
stm32_backup_domain_enable_access();
|
||||
|
||||
for (id = 0; id < RTC_STM32_ALARMS_COUNT; id++) {
|
||||
if (rtc_stm32_is_active_alarm(RTC, (uint16_t)id) != 0) {
|
||||
stm32_backup_domain_enable_access();
|
||||
LL_RTC_DisableWriteProtection(RTC);
|
||||
rtc_stm32_clear_alarm_flag(RTC, (uint16_t)id);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
stm32_backup_domain_disable_access();
|
||||
|
||||
if (id == RTC_STM32_ALRM_A) {
|
||||
p_rtc_alrm = &(data->rtc_alrm_a);
|
||||
@ -305,8 +305,6 @@ void rtc_stm32_isr(const struct device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
stm32_backup_domain_disable_access();
|
||||
|
||||
ll_func_exti_clear_rtc_alarm_flag(RTC_STM32_EXTI_LINE);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user