Skip to content

Commit 34744a6

Browse files
committed
fix: build issue
1 parent 50ffe71 commit 34744a6

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/rtc.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,9 @@ void RTC_GetDate(uint8_t *year, uint8_t *month, uint8_t *day, uint8_t *wday)
813813
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)
814814
{
815815
RTC_AlarmTypeDef RTC_AlarmStructure = {0};
816-
816+
#if !defined(RTC_SSR_SS)
817+
UNUSED(subSeconds);
818+
#endif
817819
/* Ignore time AM PM configuration if in 24 hours format */
818820
if (initFormat == HOUR_FORMAT_24) {
819821
period = HOUR_AM;
@@ -849,8 +851,6 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
849851
} else {
850852
RTC_AlarmStructure.AlarmSubSecondMask = RTC_ALARMSUBSECONDMASK_ALL;
851853
}
852-
#else
853-
UNUSED(subSeconds);
854854
#endif /* RTC_SSR_SS */
855855
if (period == HOUR_PM) {
856856
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
880880
}
881881
}
882882
#else
883-
UNUSED(subSeconds);
884883
UNUSED(period);
885884
UNUSED(day);
886885
UNUSED(mask);
@@ -890,11 +889,12 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
890889
HAL_RTC_SetAlarm_IT(&RtcHandle, &RTC_AlarmStructure, RTC_FORMAT_BIN);
891890
HAL_NVIC_SetPriority(RTC_Alarm_IRQn, RTC_IRQ_PRIO, RTC_IRQ_SUBPRIO);
892891
HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn);
892+
}
893893
#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)) {
895895
/* We have an SubSecond alarm to set in RTC_BINARY_MIX or RTC_BINARY_ONLY mode */
896896
#else
897-
} else {
897+
else {
898898
#endif /* RTC_ICSR_BIN */
899899
#if defined(RTC_SSR_SS)
900900
{
@@ -917,16 +917,14 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
917917
/* The subsecond in ms is converted in ticks unit 1 tick is 1000 / fqce_apre */
918918
RTC_AlarmStructure.AlarmTime.SubSeconds = UINT32_MAX - (subSeconds * fqce_apre) / 1000;
919919
}
920-
921-
#else
922-
UNUSED(subSeconds);
923920
#endif /* RTC_SSR_SS */
924921
/* Set RTC_Alarm */
925922
HAL_RTC_SetAlarm_IT(&RtcHandle, &RTC_AlarmStructure, RTC_FORMAT_BIN);
926923
HAL_NVIC_SetPriority(RTC_Alarm_IRQn, RTC_IRQ_PRIO, RTC_IRQ_SUBPRIO);
927924
HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn);
925+
}
928926
#if defined(RTC_ICSR_BIN)
929-
} else {
927+
else {
930928
/* We have an SubSecond alarm to set in BCD (RTC_BINARY_NONE) mode */
931929
#if defined(RTC_SSR_SS)
932930
{
@@ -947,9 +945,6 @@ void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, u
947945
}
948946
RTC_AlarmStructure.AlarmTime.SubSeconds = subSeconds * fqce_apre / 1000;
949947
}
950-
951-
#else
952-
UNUSED(subSeconds);
953948
#endif /* RTC_SSR_SS */
954949
/* Set RTC_Alarm */
955950
HAL_RTC_SetAlarm_IT(&RtcHandle, &RTC_AlarmStructure, RTC_FORMAT_BIN);

0 commit comments

Comments
 (0)