1
0
Fork 0
InfiniTime/src/components
NeroBurner a0cd439efc
Alarm persist to flash (#1367)
* AlarmController: Add saving alarm time to file

Save the set alarm time to the SPI NOR flash, so it does not reset to
the default value when the watch resets, e.g. due to watchdog timeout
or reflashing of a new version of InfiniTime.

Just like the `Settings.h` `LoadSettingsFromFile()` the previous alarm
at boot (if available) and `SaveSettingsToFile()` the current alarm when
the `Alarm.h` screen is closed (only if the settings have changed).

The alarm-settings file is stored in `.system/alarm.dat`. The `.system`
folder is created if it doesn't yet exist.

Fixes: https://github.com/InfiniTimeOrg/InfiniTime/issues/1330

* alarmController: close .system dir after usage

Close the `lfs_dir` object for the `.system` dir after usage. Otherwise
on the second changed alarm the system will lockup because the `.system`
dir is already open and was never closed.

---------

Co-authored-by: Galdor Takacs <g@ldor.de>
2024-09-28 08:14:08 +02:00
..
alarm Alarm persist to flash (#1367) 2024-09-28 08:14:08 +02:00
battery linearapproximation: Move to src/utility 2023-03-27 22:12:32 +00:00
ble Refactor SystemTask state handling for resilience 2024-09-21 21:08:07 +02:00
brightness aod: PPI/RTC-based backlight brightness 2024-08-05 20:32:43 +02:00
datetime Continuous time updates 2024-06-09 18:34:07 +02:00
firmwarevalidator Update includes to to be relative to src directory 2021-11-15 22:02:49 +01:00
fs LVGL / FS : Initialize the LVGL FS driver in LittleVgl (instead of FS). 2023-02-26 22:10:03 +02:00
heartrate Atomic HRS reads (#1845) 2024-09-22 00:29:15 +02:00
motion lowersleep: Improve algorithm by checking wrist angle 2024-03-12 19:14:58 +01:00
motor src: Enable unused parameter warning 2023-01-24 10:43:17 +02:00
rle Update includes to to be relative to src directory 2021-11-15 22:02:49 +01:00
settings aod: simplify AOD disablement based on notification status 2024-08-05 20:32:43 +02:00
timer TimerController: Rename to Timer 2023-04-16 14:33:23 +00:00