Fix stm sleep too long

This commit is contained in:
Scott Shawcroft 2020-10-13 14:02:29 -07:00
parent 3d21eec3cd
commit 56427d9abe
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
1 changed files with 1 additions and 1 deletions

View File

@ -423,7 +423,7 @@ void port_interrupt_after_ticks(uint32_t ticks) {
alarm.AlarmMask = RTC_ALARMMASK_ALL;
}
alarm.AlarmTime.SubSeconds = rtc_clock_frequency -
alarm.AlarmTime.SubSeconds = rtc_clock_frequency - 1 -
((raw_ticks % 1024) * 32);
alarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
alarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_SET;