summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/npcx/system.c2
-rw-r--r--chip/stm32/clock-f.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/chip/npcx/system.c b/chip/npcx/system.c
index 012a508208..5135fd0979 100644
--- a/chip/npcx/system.c
+++ b/chip/npcx/system.c
@@ -543,7 +543,7 @@ void system_set_rtc_alarm(uint32_t seconds, uint32_t microseconds)
{
uint32_t cur_secs, alarm_secs;
- if (seconds == EC_RTC_ALARM_CLEAR) {
+ if (seconds == EC_RTC_ALARM_CLEAR && !microseconds) {
CLEAR_BIT(NPCX_WTC, NPCX_WTC_WIE);
SET_BIT(NPCX_WTC, NPCX_WTC_PTO);
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);