@@ -813,7 +813,9 @@ void RTC_GetDate(uint8_t *year, uint8_t *month, uint8_t *day, uint8_t *wday)
813
813
void RTC_StartAlarm (alarm_t name , uint8_t day , uint8_t hours , uint8_t minutes , uint8_t seconds , uint32_t subSeconds , hourAM_PM_t period , uint8_t mask )
814
814
{
815
815
RTC_AlarmTypeDef RTC_AlarmStructure = {0 };
816
-
816
+ #if !defined(RTC_SSR_SS )
817
+ UNUSED (subSeconds );
818
+ #endif
817
819
/* Ignore time AM PM configuration if in 24 hours format */
818
820
if (initFormat == HOUR_FORMAT_24 ) {
819
821
period = HOUR_AM ;
@@ -849,8 +851,6 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
849
851
} else {
850
852
RTC_AlarmStructure .AlarmSubSecondMask = RTC_ALARMSUBSECONDMASK_ALL ;
851
853
}
852
- #else
853
- UNUSED (subSeconds );
854
854
#endif /* RTC_SSR_SS */
855
855
if (period == HOUR_PM ) {
856
856
RTC_AlarmStructure .AlarmTime .TimeFormat = RTC_HOURFORMAT12_PM ;
@@ -880,7 +880,6 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
880
880
}
881
881
}
882
882
#else
883
- UNUSED (subSeconds );
884
883
UNUSED (period );
885
884
UNUSED (day );
886
885
UNUSED (mask );
@@ -890,11 +889,12 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
890
889
HAL_RTC_SetAlarm_IT (& RtcHandle , & RTC_AlarmStructure , RTC_FORMAT_BIN );
891
890
HAL_NVIC_SetPriority (RTC_Alarm_IRQn , RTC_IRQ_PRIO , RTC_IRQ_SUBPRIO );
892
891
HAL_NVIC_EnableIRQ (RTC_Alarm_IRQn );
892
+ }
893
893
#if defined(RTC_ICSR_BIN )
894
- } else if ((initMode == MODE_BINARY_MIX ) || (initMode == MODE_BINARY_ONLY )) {
894
+ else if ((initMode == MODE_BINARY_MIX ) || (initMode == MODE_BINARY_ONLY )) {
895
895
/* We have an SubSecond alarm to set in RTC_BINARY_MIX or RTC_BINARY_ONLY mode */
896
896
#else
897
- } else {
897
+ else {
898
898
#endif /* RTC_ICSR_BIN */
899
899
#if defined(RTC_SSR_SS )
900
900
{
@@ -917,16 +917,14 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
917
917
/* The subsecond in ms is converted in ticks unit 1 tick is 1000 / fqce_apre */
918
918
RTC_AlarmStructure .AlarmTime .SubSeconds = UINT32_MAX - (subSeconds * fqce_apre ) / 1000 ;
919
919
}
920
-
921
- #else
922
- UNUSED (subSeconds );
923
920
#endif /* RTC_SSR_SS */
924
921
/* Set RTC_Alarm */
925
922
HAL_RTC_SetAlarm_IT (& RtcHandle , & RTC_AlarmStructure , RTC_FORMAT_BIN );
926
923
HAL_NVIC_SetPriority (RTC_Alarm_IRQn , RTC_IRQ_PRIO , RTC_IRQ_SUBPRIO );
927
924
HAL_NVIC_EnableIRQ (RTC_Alarm_IRQn );
925
+ }
928
926
#if defined(RTC_ICSR_BIN )
929
- } else {
927
+ else {
930
928
/* We have an SubSecond alarm to set in BCD (RTC_BINARY_NONE) mode */
931
929
#if defined(RTC_SSR_SS )
932
930
{
@@ -947,9 +945,6 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
947
945
}
948
946
RTC_AlarmStructure .AlarmTime .SubSeconds = subSeconds * fqce_apre / 1000 ;
949
947
}
950
-
951
- #else
952
- UNUSED (subSeconds );
953
948
#endif /* RTC_SSR_SS */
954
949
/* Set RTC_Alarm */
955
950
HAL_RTC_SetAlarm_IT (& RtcHandle , & RTC_AlarmStructure , RTC_FORMAT_BIN );
0 commit comments