summaryrefslogtreecommitdiff
path: root/chip/stm32/clock-f.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/clock-f.c')
-rw-r--r--chip/stm32/clock-f.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/stm32/clock-f.c b/chip/stm32/clock-f.c
index 51d3511e0e..b64903de44 100644
--- a/chip/stm32/clock-f.c
+++ b/chip/stm32/clock-f.c
@@ -167,6 +167,11 @@ void set_rtc_alarm(uint32_t delay_s, uint32_t delay_us,
{
uint32_t alarm_sec, alarm_us;
+ if (delay_s == EC_RTC_ALARM_CLEAR && !delay_us) {
+ reset_rtc_alarm(rtc);
+ return;
+ }
+
/* Alarm must be within 1 day (86400 seconds) */
ASSERT((delay_s + delay_us / SECOND) < SECS_PER_DAY);