Merge pull request #3549 from tannewt/stm_alarm_tweak

Fix stm sleep too long
This commit is contained in:
Scott Shawcroft 2020-10-14 11:12:26 -07:00 committed by GitHub
commit cc8f8d8604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;