aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/alarm
Commit message (Collapse)AuthorAgeFilesLines
* Alarm: Simplify alarm alerting screen (#2211)ljahn2025-01-211-1/+0
| | | | | | | | | | | | Simplify alarm alerting screen and fix bug with alerting on time value change SetAlerting creates an lv_task to automatically call StopAlerting after one minute. This task will call an invalid function reference and lead to a crash under the following condition: All exit paths but the time value change (so not considering this fix) call StopAlerting themselves, which also terminates the lv_task. However, the value change callback only calls DisableAlarm, because its normal use case is for setting up an alarm, where you have to re-confirm enabling the alarm after every change you make. DisableAlarm still sets isAlerting in the alarmController to false, probably because someone thought a currently alerting but also disabled alarm makes no sense, this was introduced in a0cd439. That causes the destructor of Alarm to think there is nothing to do regarding the alerting when the alarm screen is dismissed. Therefore it does not call StopAlerting and the lv_task is left with an invalid function pointer, because Alarm does not exist anymore once the lv_task finally goes to call the callback function
* Alarm persist to flash (#1367)NeroBurner2024-09-282-27/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* SystemTask: Move MotorController to DisplayAppRiku Isokoski2023-02-251-1/+0
| | | | | Vibrations should be associated with something happening on the UI. Therefore SystemTask should not be controlling the motor.
* Format header filesFinlay Davidson2023-01-091-0/+6
| | | | In my PR updating clang-format, I forgot to also format the headers.
* Update clang-tidy configuration and fix some warnings (#1474)Riku Isokoski2022-12-181-1/+1
| | | | | Don't enable coding conventions from unrelated projects. Only enable generic checks.
* AlarmController: add const to SecondsToAlarm() functionReinhold Gschweicher2022-09-272-2/+2
| | | | | | The function `SecondsToAlarm()` doesn't change anything in the `AlarmController` object. Mark the function `const` to show this property.
* Switch to freertos timers (#1095)Michele Bini2022-06-062-17/+14
| | | | | | | | | | | * Use FreeRTOS timer for AlarmController * Use FreeRTOS timer for MotorController * Remove app_timer component from compilation as we now solely use FreeROTS timer * Simplify variable and text names for AlarmController and MotorController timers * Call ScheduleAlarm directly from StopAlerting, for recurring timers Co-authored-by: Riku Isokoski <riksu9000@gmail.com> Co-authored-by: NeroBurner <pyro4hell@gmail.com>
* Apply clang-format to all C++ filesFinlay Davidson2022-06-051-2/+1
|
* AlarmController: allow loss of precision for alarmTime castReinhold Gschweicher2022-03-291-1/+2
| | | | | Allow a loss of precision if the system clock has a lower resolution than nanoseconds. This is the case for web assembly.
* AlarmController: remove unused app_timer.h include in headerReinhold Gschweicher2021-12-091-1/+0
|
* Update includes to to be relative to src directoryReinhold Gschweicher2021-11-151-1/+1
| | | | | | | Don't use relative imports like `../foo.h` as those depend on the relative position of both files. Rather than that use imports relative to the `src` directory, which explicitly is part of the include directories.
* Fixes per Riksu9000's feedbackMark Russell2021-09-162-7/+7
|
* License header fix, add missing bracesMark Russell2021-09-132-3/+12
|
* Fixes based on code reviews (formatting, UI code)Mark Russell2021-09-132-35/+40
|
* Created basic alarm appMark Russell2021-09-102-0/+168