aboutsummaryrefslogtreecommitdiffstats
path: root/src/systemtask/SystemTask.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Alarm persist to flash (#1367)NeroBurner2024-09-281-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Refactor doNotGoToSleep to a wakelock countermark90642024-09-211-10/+6
|
* Refactor SystemTask state handling for resiliencemark90642024-09-211-78/+64
| | | | | | State transitions now happen immediately where possible This simplifies state management in general, and prevents bugs such as the chime issue from occurring in the first place
* Clean unused DisplayApp messagesmark90642024-09-141-5/+0
|
* aod: fix brightness getting stuck highmark90642024-08-051-5/+5
|
* aod: integrate with display timeoutJohn Crawford2024-08-051-2/+2
|
* aod: PPI/RTC-based backlight brightnessmark90642024-08-051-1/+3
|
* feat: always on displayKaffeinatedKat2024-08-051-4/+11
|
* Continuous time updatesmark90642024-06-091-2/+0
|
* Simplify ISR task wake checksmark90642024-03-121-4/+1
| | | | The macro checks the variable, so we don't need to check it ourselves
* Fix chimesmark90642024-03-121-0/+8
|
* Only inhibit sleep if motion notifications are enabled, not just Bluetoothapilat2024-01-231-3/+3
|
* Keep updating motion during sleep when Bluetooth is onapilat2024-01-231-2/+3
|
* Application selection at build timeJean-François Milants2023-11-191-0/+3
| | | | | | | A list of "user applications" is built at compile time. It contains all the info needed to create the application at runtime (ptr to a create() function) and to display the app in the application menu. All applications declare a TypeTrait with these information. When a new app must be loaded, DisplayApp first check if this app is a System app (in which case it creates it like it did before). If it's not a System app, it looks for the app in the list of User applications and creates it if it found it. Those changes allow to more easily add new app and to select which app must be built into the firmware. Switch to C++20 (and fix a few issues in SpiMaster.cpp and Watchdog.cpp.
* lowersleep: Implement Lower to Sleep functionality (#827)FintasticMan2023-08-271-0/+4
|
* raisewake: Improve raise to wake algorithmFinlay Davidson2023-08-171-1/+1
| | | | | | | | | | | | | This new algorithm calculates the number of degrees that the wrist has rolled, and checks if that is above a threshold. First it checks if the wrist is still enough for the acceleration values to be considered mostly from gravity. It does this by calculating the mean over the past 2 SystemTask loops, and checking that the variance from that mean is below a threshold. Then it calculates the angle the wrist is being held at, and calculates the difference from the angle some time ago. If this difference is above the threshold, it wakes the watch.
* Refactor, document and fix the Watchdog driver (#1710)JF2023-04-301-3/+3
| | | | | | | * Refactor and document the Watchdog driver to make it more readable. Fix the configuration of the behaviours configuration that was not properly implemented (but it didn't cause any side effect since the correct value was eventually set in NRF_WDT->CONFIG). Fix the wrong interpretation of the reset reasons caused by implicit conversions of int to bool.
* TimerController: Make TimerController reusableRiku Isokoski2023-04-161-9/+0
| | | | TimerController instance was moved to DisplayApp.
* MotionController: Remove IsOk variableRiku Isokoski2023-04-161-1/+0
| | | | We should be able to assume MotionController is safe to use.
* inactivity: Use LVGL inactivity timersRiku Isokoski2023-03-181-63/+5
| | | | | | | | | | | | | | | | | Replace custom FreeRTOS inactivity timers with LVGL inactivity timers. DisplayApp: Trigger display activity on timer done. inactivity: Add additional checks The backlight could be turned on by RestoreBrightness() on ble connect event. inactivity: Trigger activity on screen switch A notification timing out could put the watch to sleep immediately. While this could be ideal behaviour, it was caused by delay in processing the EnableSleeping event and pushing RestoreBrightness to DisplayApp.
* raisewake: Change names in line with the style guideFinlay Davidson2023-03-091-1/+1
|
* shakewake: Fix names according to style guideFinlay Davidson2023-03-091-1/+1
|
* Revert "added low battery message"Riku Isokoski2023-03-021-12/+0
| | | | This reverts PR https://github.com/InfiniTimeOrg/InfiniTime/pull/1352
* SystemTask: Move lcd to DisplayAppRiku Isokoski2023-02-251-5/+0
| | | | SystemTask should never write to the lcd
* LittleVgl: Instantiate in DisplayAppRiku Isokoski2023-02-251-2/+0
| | | | | | | LVGL is only a part of the main DisplayApp. Other "DisplayApps" can be implemented without LVGL. DummyLittleVgl isn't needed anymore and has been removed
* SystemTask: Move MotorController to DisplayAppRiku Isokoski2023-02-251-14/+3
| | | | | Vibrations should be associated with something happening on the UI. Therefore SystemTask should not be controlling the motor.
* TouchHandler: Do not store touch panel referenceRiku Isokoski2023-02-241-2/+2
|
* touchhandler: Remove LVGL dependencyRiku Isokoski2023-02-241-3/+2
| | | | Move LVGL specific code to the LittleVgl class
* Include algorithm and cstring for std::memcpy and std::minJean-François Milants2022-12-271-0/+2
|
* Update src/systemtask/SystemTask.cppMax Friedrich2022-12-271-4/+4
| | | Co-authored-by: JF <JF002@users.noreply.github.com>
* hopefully fixed crash on notificationminacode2022-12-271-1/+1
|
* formatminacode2022-12-271-1/+2
|
* removed magic numberminacode2022-12-271-1/+1
|
* added punctuationminacode2022-12-271-2/+2
|
* added message, changed UIminacode2022-12-271-2/+2
|
* formatminacode2022-12-271-11/+9
|
* added low battery messageminacode2022-12-271-0/+11
|
* Update clang-tidy configuration and fix some warnings (#1474)Riku Isokoski2022-12-181-11/+9
| | | | | Don't enable coding conventions from unrelated projects. Only enable generic checks.
* Fix clang-tidy warningsRiku Isokoski2022-10-101-1/+1
|
* Add sleep mode which disables notifications, touch- and motion wakeup (#1261)Riku Isokoski2022-08-211-11/+14
|
* Switch to freertos timers (#1095)Michele Bini2022-06-061-3/+0
| | | | | | | | | | | * 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>
* System: Refactor pin and interrupt setupChristoph Honal2022-06-051-19/+9
| | | | | | This should ensure better readability of the pin setup procedure, as well as allow the configuration of the hardware button enable pin and the accelerometer interrupt pin via the pin mapping header.
* SystemTask: Use "&&" instead of "and" for operatorsChristoph Honal2022-06-051-5/+6
| | | | As per the coding style, only primary spelling should be used for operators.
* Fix various typosluz paz2022-06-051-1/+1
| | | | Found via `codespell -q 3 -S ./src/libs -L ans,doubleclick,trough`
* Fix and test workflowRiku Isokoski2022-05-081-2/+2
|
* Systemtask : replace enum SystemTaskState by an enum class.Jean-François Milants2022-05-081-22/+22
|
* Simplify systemtask statesRiku Isokoski2022-05-081-32/+30
|
* Replace app_timer with FreeRTOS timersRiku Isokoski2022-04-251-3/+2
|
* Let TouchHandler return TouchEvents instead of driver specific enumReinhold Gschweicher2022-04-131-3/+4
| | | | | | | | Let the TouchHandler::GestureGet() function return a TouchEvent instead of the touchpanel-driver specific enum. This helps to move the driver specific helper function `ConvertGesture` from `DisplayApp` into `TouchHandler`.
* In current configuration, the timer task (the one from FreeRTOS) has the ↵Jean-François Milants2022-03-211-1/+1
| | | | | | | | | | | | | | lowest priority (0). Both display and system tasks are also set on priority 0. In cases where any other task takes too much time to execute (it can happen in Display Task, see https://github.com/InfiniTimeOrg/InfiniTime/issues/825), the timer task does not have the opportunity to run fast enough to detect and debounce presses on the button. This commit sets the following priorities: - [0] : Display Task - [1] : Timer and System tasks - [2] : BLE Host - [3] : BLE LL This way, we ensure that button presses will always be detected, even if the rendering of the display takes a huge amount of time.