aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp/DisplayApp.cpp
Commit message (Collapse)AuthorAgeFilesLines
* weather: Add new app with forecastVictor Kareh2024-02-181-0/+1
|
* New dice-rolling app: InfiniDice! (#1326)Yusuf Ebrahim2024-01-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new App `Dice.h` to randomly roll the dice(s). The number of dice can range from 1-9 (default 1), and the sides can range from d2-d99 (default d2). To have a haptic feedback we make Dice vibrate on roll. Regarding the use of C++ `<random>` library: There are known problems with `rand()` and `srand()` (see https://en.cppreference.com/w/cpp/numeric/random/rand) and the `<random>` library is preferred for this reason. The function used from `<random>` also avoids a very rare bias that would occur using `rand()` and modulo, when `RAND_MAX` is not a multiple of `d` and the initially generated number falls in the last "short" segment. This commit also updates the seed to derive entropy (via `seed_seq`) from a mix of the system tick count and the x,y,z components of the PineTime motion controller -- taking inspiration from and with credit to @w4tsn (https://github.com/InfiniTimeOrg/InfiniTime/pull/1199) Thanks for suggestions: * in Dice, when rolling 1d2, also show "HEADS" or "TAILS" -- suggestion by @medeyko * ui adjustments and result realignment -- suggestion by @Boteium --------- Co-authored-by: NeroBurner <pyro4hell@gmail.com> Co-authored-by: Riku Isokoski <riksu9000@gmail.com> Co-authored-by: Paul Weiß <45500341+Poohl@users.noreply.github.com> Co-authored-by: FintasticMan <finlay.neon.kid@gmail.com>
* Watch face selection using CMakeJean-François Milants2024-01-061-2/+3
| | | | | | The list of watch face to build into the firmware is now set by CMake (-DENABLE_WATCHFACES). Fix SettingWatchFace : convert to index to/from WatchFace when needed.
* settings: Add settings item for weather formatFintasticMan2023-12-231-0/+4
|
* SimpleWeather service : new weather implementationJean-François Milants2023-12-231-2/+1
| | | | | | | | | | This new implementation of the weather feature provides a new BLE API and a new weather service. The API uses a single characteristic that allows companion apps to write the weather conditions (current and forecast for the next 5 days). The SimpleWeather service exposes those data as std::optional fields. This new implementation replaces the previous WeahterService. The API is documented in docs/SimpleWeatherService.md.
* Watch face selection at build timeJean-François Milants2023-12-211-26/+22
| | | | Watch faces can now be selected at buid time. It's implemented in a similar way than the selection of user apps, using a list of watch face description that is generated at build time (consteval, constexpr)
* Fix code formattingJean-François Milants2023-11-191-7/+19
|
* Application selection at build timeJean-François Milants2023-11-191-49/+53
| | | | | | | 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.
* Fix deadlock when a lot of notifications are received in a very short time span.Jean-François Milants2023-11-191-1/+9
| | | | | | | When a notification is received, SystemTask sends messages to DisplayApp, which loads the Notifications apps that sends a few messages to SystemApp. When notification are received too quickly, DisplayApp and SystemTask cannot process those messages fast enough (probably because of the time it takes to refresh the display) and the message queues fill up. When they are full, the current implementation just waits until there's room available to store the event. In this case, since both tasks exchange messages, they end up in a deadlock. This fix consists in setting the timeout value to 0 (non-blocking mode) for the NewNotification messages on the DisplayApp side. This will prevent the SystemTask from being blocked (which would result in the watchdog reseting the watch). A more generic approach should be design in the future.
* navigation: Add is available (#1847)JF2023-09-021-1/+1
| | | | | Navigation app now needs 2 images to be loaded from the resources on the external filesystem. This PR adds an 'enabled' field to the Applications struct. This field is true for all applications expect for Navigation which calls Navigation::IsAvailable(). This methods returns true if the 2 files are available in the resources. The application list disables the application (draws it in grey, disables the touch callback) if the enable flag is not set.
* PineTimeStyle weather display (#1459)kieranc2023-06-041-0/+7
| | | | | Weather display for PineTimeStyle Documentation : https://wiki.pine64.org/wiki/PineTimeStyle and https://wiki.pine64.org/wiki/Infinitime-Weather
* TimerController: Rename to TimerRiku Isokoski2023-04-161-2/+2
|
* TimerController: Make TimerController reusableRiku Isokoski2023-04-161-3/+10
| | | | TimerController instance was moved to DisplayApp.
* inactivity: Use LVGL inactivity timersRiku Isokoski2023-03-181-6/+41
| | | | | | | | | | | | | | | | | 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.
* LVGL / FS : Initialize the LVGL FS driver in LittleVgl (instead of FS).Jean-François Milants2023-02-261-1/+1
| | | | | | Previously, the LVGL driver for the filesystem was initialized in the class FS. However, since 6f942e2, the order of the initializations was incorrect : the driver was initialized (FS::LVGLFileSystemInit()) before LVGL (LittleVgl.Init()), which means that the driver registration was probably dropped when LVGL was initialized. The LVGL driver is now initialized in LittleVgl.Init(), which seems to make much more sense, since all LVGL drivers are initialized there. This way, we ensure that the initialization of the drivers is consistent.
* motion: Disable Motion appRiku Isokoski2023-02-251-3/+3
| | | | | This is a debugging app, not useful for most people. Also remove the app icon.
* SystemTask: Move lcd to DisplayAppRiku Isokoski2023-02-251-0/+3
| | | | SystemTask should never write to the lcd
* LittleVgl: Instantiate in DisplayAppRiku Isokoski2023-02-251-3/+4
| | | | | | | 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
* watchdog: Replace WatchdogView with const WatchdogRiku Isokoski2023-02-251-1/+1
|
* screens: Remove unused DisplayApp parametersRiku Isokoski2023-02-251-26/+24
|
* SystemTask: Move MotorController to DisplayAppRiku Isokoski2023-02-251-2/+11
| | | | | Vibrations should be associated with something happening on the UI. Therefore SystemTask should not be controlling the motor.
* displayapp: Make Ble references constRiku Isokoski2023-02-241-1/+1
|
* displayapp: Make Cst816S references constRiku Isokoski2023-02-241-1/+1
|
* displayapp: Make Battery class references constRiku Isokoski2023-02-241-1/+1
|
* touchhandler: Remove LVGL dependencyRiku Isokoski2023-02-241-2/+3
| | | | Move LVGL specific code to the LittleVgl class
* Combine Date and Time Settings (#1465)John Quigley2023-01-141-7/+3
| | | | | | Replace separate SettingSetDate and SettingSetTime with a combined screenlist. Add DotIndicators. Similar to PageIndicator, but for use when separating screens instead of pages of a list. Co-authored-by: Riku Isokoski <riksu9000@gmail.com>
* Fix returning to the same screenRiku Isokoski2023-01-051-2/+7
|
* Implement a return app stackRiku Isokoski2023-01-051-50/+57
| | | | | | Each opened app (screen) is pushed on a stack, which is then popped from when returning instead of hard coded "previous apps". Return swipe and refresh directions are automatically determined from the app transition.
* Update clang-{format,tidy} to 14Finlay Davidson2023-01-041-0/+1
| | | | | Also add configuration options only available in 13 and 14. Fixes warning about -fstack-usage in clang-tidy check.
* Update clang-tidy configuration and fix some warnings (#1474)Riku Isokoski2022-12-181-6/+4
| | | | | Don't enable coding conventions from unrelated projects. Only enable generic checks.
* Watch face settings : disable watch faces that are not available (external ↵Jean-François Milants2022-10-111-1/+1
| | | | resources are not installed).
* Fix clang-tidy warningsRiku Isokoski2022-10-101-1/+1
|
* Brightness management in DisplayApp : do not allow the brightness level OFF ↵Jean-François Milants2022-10-021-4/+13
| | | | when loading app and going to running mode. Such issue could occur in case of inconsistent or corrupted settings.
* Fix formattingJean-François Milants2022-09-111-1/+1
|
* Infineat : Add support for external resources, and read the images and fonts ↵Jean-François Milants2022-09-111-3/+6
| | | | from the ilesystem
* Use Counter widget in AlarmRiku Isokoski2022-08-021-1/+1
|
* Add status icons widgetRiku Isokoski2022-08-021-2/+4
|
* Reset timer by long pressing on the button (#1214)Riku Isokoski2022-07-211-1/+1
| | | | | | | | * Reset timer by long pressing on the button * Consider press_lost as released Otherwise the bar would keep increasing if the finger slid off the button
* Always restore brightness on app switch (#1213)Riku Isokoski2022-07-211-1/+2
|
* Remove backup brightness feature (#1180)Riku Isokoski2022-06-181-11/+10
| | | This feature is not needed and is probably more likely to cause issues. It's better to just use brightnessController.Set(settingsController.GetBrightness());
* remove unused Meter.cpp and Meter.h (#1171)mabuch2022-06-051-1/+0
|
* remove unused Brightness App (#1170)mabuch2022-06-051-1/+0
|
* Apply clang-format to all C++ filesFinlay Davidson2022-06-051-8/+26
|
* Remove lcd from DisplayAppRiku Isokoski2022-05-081-2/+0
|
* Let TouchHandler return TouchEvents instead of driver specific enumReinhold Gschweicher2022-04-131-23/+1
| | | | | | | | 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`.
* Replace airplane mode with a bluetooth toggleRiku Isokoski2022-04-021-3/+3
|
* Timer App : add background label to ensure that the app will be displayed ↵Jean-François Milants2022-03-281-1/+1
| | | | | | correctly after a full refresh (HW scrolling transition). Code cleaning and rename methods.
* DisplayApp : Call the event handler of the current app before loading the ↵Jean-François Milants2022-03-281-4/+4
| | | | new one. This way, we ensure that lv_task_handler() is called before sending event to the newly loaded app.
* Merge branch 'airplane-mode' of https://github.com/evergreen22/InfiniTime ↵Jean-François Milants2022-02-201-2/+2
| | | | | | | | | | | | | into evergreen22-airplane-mode Apply a few changes that were requested in the PR during the review. # Conflicts: # src/CMakeLists.txt # src/displayapp/Apps.h # src/displayapp/DisplayApp.cpp # src/displayapp/Messages.h # src/displayapp/screens/settings/Settings.cpp
* Merge branch 'airplane-mode' of https://github.com/evergreen22/InfiniTime ↵Jean-François Milants2022-02-201-0/+8
|\ | | | | | | | | | | | | | | | | | | | | into evergreen22-airplane-mode # Conflicts: # src/CMakeLists.txt # src/displayapp/Apps.h # src/displayapp/DisplayApp.cpp # src/displayapp/Messages.h # src/displayapp/screens/settings/Settings.cpp