Skip to content

Commit 56427d9

Browse files
committed
Fix stm sleep too long
1 parent 3d21eec commit 56427d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/stm/supervisor/port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ void port_interrupt_after_ticks(uint32_t ticks) {
423423
alarm.AlarmMask = RTC_ALARMMASK_ALL;
424424
}
425425

426-
alarm.AlarmTime.SubSeconds = rtc_clock_frequency -
426+
alarm.AlarmTime.SubSeconds = rtc_clock_frequency - 1 -
427427
((raw_ticks % 1024) * 32);
428428
alarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
429429
alarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_SET;

0 commit comments

Comments
 (0)