Skip to content

Commit e15ebd3

Browse files
committed
STM32: RTC: Call irq_handler whenever interrupt fires
lp_ticker driver is the known registered user of RTC handler API. In case, a lp_ticker is set in the past, the lp_ticker_fire_interrupt will be called which itself sets the RTC interrupt as pending by calling NVIC_SetPendingIRQ(RTC_WKUP_IRQn). This all happens without actual programing of the RTC wake-up. As a result the RTC HW and corresponding HAL layer doesn't expect an interrupt to happen and will not call HAL_RTCEx_WakeUpTimerEventCallback. To sove this situation, we will not use HAL_RTCEx_WakeUpTimerEventCallback weak definition but rather call handler whenever an RTC interrupt fires.
1 parent df88a9d commit e15ebd3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

targets/TARGET_STM/rtc_api.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,10 @@ int rtc_isenabled(void)
295295

296296
static void RTC_IRQHandler(void)
297297
{
298+
/* Update HAL state */
298299
HAL_RTCEx_WakeUpTimerIRQHandler(&RtcHandle);
299-
}
300-
301-
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
302-
{
300+
/* In case of registered handler, call it. */
303301
if (irq_handler) {
304-
// Fire the user callback
305302
irq_handler();
306303
}
307304
}

0 commit comments

Comments
 (0)