Skip to content

Commit 2ccc178

Browse files
committed
chore: factorize code
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 120d547 commit 2ccc178

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/STM32RTC.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -851,16 +851,7 @@ void STM32RTC::setAlarmSubSeconds(uint32_t subSeconds, Alarm name)
851851
#ifndef RTC_ALARM_B
852852
UNUSED(name);
853853
#endif
854-
if (_mode == MODE_BIN) {
855-
#ifdef RTC_ALARM_B
856-
if (name == ALARM_B) {
857-
_alarmBSubSeconds = subSeconds;
858-
} else
859-
#endif
860-
{
861-
_alarmSubSeconds = subSeconds;
862-
}
863-
} else if (subSeconds < 1000) {
854+
if ((_mode == MODE_BIN) || (subSeconds < 1000)) {
864855
#ifdef RTC_ALARM_B
865856
if (name == ALARM_B) {
866857
_alarmBSubSeconds = subSeconds;

0 commit comments

Comments
 (0)