1
mirror of https://github.com/flipperdevices/flipperzero-firmware.git synced 2025-12-12 04:41:26 +04:00

FuriHalRtc refactor: new datetime lib (#3386)

* datetimelib created
* datetimelib unit tests added
* firmware fixes to new datetimelib
* typo fix
* merge artifacts fixed, datetimelib renamed to datetime

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Leptopt1los
2024-02-15 12:44:41 +09:00
committed by GitHub
parent dd988ba449
commit feb45f6645
28 changed files with 456 additions and 275 deletions

View File

@@ -128,7 +128,7 @@ static void dolphin_update_clear_limits_timer_period(Dolphin* dolphin) {
uint32_t timer_expires_at = furi_timer_get_expire_time(dolphin->clear_limits_timer);
if((timer_expires_at - now_ticks) > HOURS_IN_TICKS(0.1)) {
FuriHalRtcDateTime date;
DateTime date;
furi_hal_rtc_get_datetime(&date);
uint32_t now_time_in_ms = ((date.hour * 60 + date.minute) * 60 + date.second) * 1000;
uint32_t time_to_clear_limits = 0;

View File

@@ -74,9 +74,9 @@ bool dolphin_state_load(DolphinState* dolphin_state) {
}
uint64_t dolphin_state_timestamp() {
FuriHalRtcDateTime datetime;
DateTime datetime;
furi_hal_rtc_get_datetime(&datetime);
return furi_hal_rtc_datetime_to_timestamp(&datetime);
return datetime_datetime_to_timestamp(&datetime);
}
bool dolphin_state_is_levelup(uint32_t icounter) {