mirror of https://github.com/ARMmbed/mbed-os.git
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.pull/5289/head
parent
df88a9dcc2
commit
e15ebd3c53
|
@ -295,13 +295,10 @@ int rtc_isenabled(void)
|
||||||
|
|
||||||
static void RTC_IRQHandler(void)
|
static void RTC_IRQHandler(void)
|
||||||
{
|
{
|
||||||
|
/* Update HAL state */
|
||||||
HAL_RTCEx_WakeUpTimerIRQHandler(&RtcHandle);
|
HAL_RTCEx_WakeUpTimerIRQHandler(&RtcHandle);
|
||||||
}
|
/* In case of registered handler, call it. */
|
||||||
|
|
||||||
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
|
|
||||||
{
|
|
||||||
if (irq_handler) {
|
if (irq_handler) {
|
||||||
// Fire the user callback
|
|
||||||
irq_handler();
|
irq_handler();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue