diff options
author | あく <alleteam@gmail.com> | 2021-12-15 01:39:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-15 01:39:59 +0300 |
commit | 6579368053a0572d1fff38ca3a91ab209df1a1d2 (patch) | |
tree | fe32d41301876edee2ef3af6002b2d005b42dbc2 /applications/dolphin | |
parent | 965067b5bd7fb3fbb77d0459cc9ea10492168ad7 (diff) |
[FL-1818] System setting and debug options. RTC HAL refactoring. (#902)
* FuriHal: RTC API refactoring. System Setting application. FuriCore: adjustable log levels. Minor code cleanup.
* Storage: change logging levels for internal storage.
* FuriCore: fix broken trace logging level
Diffstat (limited to 'applications/dolphin')
-rw-r--r-- | applications/dolphin/helpers/dolphin_state.c | 19 | ||||
-rw-r--r-- | applications/dolphin/helpers/dolphin_state.h | 1 |
2 files changed, 9 insertions, 11 deletions
diff --git a/applications/dolphin/helpers/dolphin_state.c b/applications/dolphin/helpers/dolphin_state.c index 016d8a50..9efdecb8 100644 --- a/applications/dolphin/helpers/dolphin_state.c +++ b/applications/dolphin/helpers/dolphin_state.c @@ -2,6 +2,7 @@ #include <stdint.h> #include <storage/storage.h> #include <furi.h> +#include <furi-hal.h> #include <math.h> #include <toolbox/saved_struct.h> @@ -70,20 +71,18 @@ bool dolphin_state_load(DolphinState* dolphin_state) { } uint64_t dolphin_state_timestamp() { - RTC_TimeTypeDef time; - RTC_DateTypeDef date; + FuriHalRtcDateTime datetime; struct tm current; - HAL_RTC_GetTime(&hrtc, &time, RTC_FORMAT_BIN); - HAL_RTC_GetDate(&hrtc, &date, RTC_FORMAT_BIN); + furi_hal_rtc_get_datetime(&datetime); - current.tm_year = date.Year + 100; - current.tm_mday = date.Date; - current.tm_mon = date.Month - 1; + current.tm_year = datetime.year - 1900; + current.tm_mday = datetime.day; + current.tm_mon = datetime.month - 1; - current.tm_hour = time.Hours; - current.tm_min = time.Minutes; - current.tm_sec = time.Seconds; + current.tm_hour = datetime.hour; + current.tm_min = datetime.minute; + current.tm_sec = datetime.second; return mktime(¤t); } diff --git a/applications/dolphin/helpers/dolphin_state.h b/applications/dolphin/helpers/dolphin_state.h index 1196e256..8c9f3aa9 100644 --- a/applications/dolphin/helpers/dolphin_state.h +++ b/applications/dolphin/helpers/dolphin_state.h @@ -3,7 +3,6 @@ #include "dolphin_deed.h" #include <stdbool.h> #include <stdint.h> -#include <rtc.h> #include <time.h> typedef struct DolphinState DolphinState; |