Skip to content

Commit 4b159ae

Browse files
committed
stop alarm : the HAL deactivate function is clearing the alarm Flags
1 parent 4db6f84 commit 4b159ae

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
@@ -810,16 +810,8 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
810810
*/
811811
void RTC_StopAlarm(alarm_t name)
812812
{
813-
/* Clear RTC Alarm Flag */
814-
#ifdef RTC_ALARM_B
815-
if (name == ALARM_B) {
816-
__HAL_RTC_ALARM_CLEAR_FLAG(&RtcHandle, RTC_FLAG_ALRBF);
817-
} else
818-
#endif
819-
{
820-
__HAL_RTC_ALARM_CLEAR_FLAG(&RtcHandle, RTC_FLAG_ALRAF);
821-
}
822-
/* Disable the Alarm A interrupt */
813+
/* Clear RTC Alarm Flag : done in the HAL_RTC_DeactivateAlarm function */
814+
/* Disable the Alarm interrupt */
823815
HAL_RTC_DeactivateAlarm(&RtcHandle, name);
824816
}
825817

0 commit comments

Comments
 (0)