Skip to content

Commit 23d55e4

Browse files
committed
stop alarm : the HAL deactivate function is clearing the alarm Flags
1 parent 0cad1db commit 23d55e4

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/rtc.c

+2-10
Original file line numberDiff line numberDiff line change
@@ -812,16 +812,8 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
812812
*/
813813
void RTC_StopAlarm(alarm_t name)
814814
{
815-
/* Clear RTC Alarm Flag */
816-
#ifdef RTC_ALARM_B
817-
if (name == ALARM_B) {
818-
__HAL_RTC_ALARM_CLEAR_FLAG(&RtcHandle, RTC_FLAG_ALRBF);
819-
} else
820-
#endif
821-
{
822-
__HAL_RTC_ALARM_CLEAR_FLAG(&RtcHandle, RTC_FLAG_ALRAF);
823-
}
824-
/* Disable the Alarm A interrupt */
815+
/* Clear RTC Alarm Flag : done in the HAL_RTC_DeactivateAlarm function */
816+
/* Disable the Alarm interrupt */
825817
HAL_RTC_DeactivateAlarm(&RtcHandle, name);
826818
}
827819

0 commit comments

Comments
 (0)