Commit graph

1635 commits

Author SHA1 Message Date
mark9064 b3f4831e54 Initialise DisplayApp components in DisplayApp context 2025-06-28 16:33:49 +01:00
mark9064 343962da5d Disable legacy FreeRTOS functions 2025-06-27 20:53:26 +01:00
Eshe 4517fb8c4b
Pride flag watchface (#2201) 2025-06-19 17:53:45 +01:00
Titus b2d0e04e42
BatteryInfo App Redesign: Fixup (#2310)
* remove leading zeros from battery percentage
* add correct colors matching the battery icon color thresholds
2025-06-12 09:13:53 +02:00
lmamane 4f426f00a8
set static text as static text (#2312)
and save a few bytes of heap memory

Co-authored-by: Lionel Elie Mamane <lionel@mamane.lu>
2025-06-12 09:12:11 +02:00
Reinhold Gschweicher 85a0542d93 DisplayApp: use std::ranges function where possible
Instead of raw for loops use `std::ranges::transform` where possible.
And also use `std::ranges::find_if` instead of `std::find_if`.
2025-05-30 22:57:12 +01:00
Steve Amor 9fb35cc073 Refactors watch faces. Replace lv_tick_get() with xTaskGetTickCount() 2025-05-23 17:46:14 +01:00
Jean-François Milants 0880b08546 Fix conflict in NotificationManager 2025-05-21 20:53:47 +02:00
Matt Zrinsky fb70b538e4 Fix about screen vertical centering.
There was a newline at the end of the last line on the third screen,
which was causing the label to not be centered vertically.
Removing it fixes the centering.
2025-05-19 21:49:46 +02:00
Titus bb8923b56e
Center text on timer button (#2229) 2025-05-16 23:01:19 +02:00
Max Friedrich 4e1ee90286
Remove the vibration while charging (#1768)
* DisplayApp.cpp: Remove the vibration from OnChargingEvent

This fixes a bug where the vibration interupts the physical connection with the charger and therefore triggers a new charging event and vibration, ending in a cycle of vibrations while charging.

* remove OnChargingEvent message from DisplayApp

---------

Co-authored-by: minacode <minamoto9@web.de>
2025-05-16 21:29:06 +02:00
Titus 85be83beab
Add background color to progress bar when flashing firmware (#2237) 2025-05-15 20:46:25 +01:00
Max Friedrich 5b20e8e2ba
Simple calculator (#1483)
Co-authored-by: minacode <minamoto9@web.de>
Co-authored-by: Finlay Davidson <finlay.davidson@coderclass.nl>
Co-authored-by: SuIông N. <Boteium@users.noreply.github.com>
Co-authored-by: mark9064 <30447455+mark9064@users.noreply.github.com>
2025-05-12 23:32:03 +01:00
lmamane c0638c6007
work around g++ version 12, 13 and 14 spurious warning (#2158)
which is an error since we compile with -Werror

Co-authored-by: Lionel Elie Mamane <lionel@mamane.lu>
2025-03-14 13:10:41 +01:00
Titus 30e56834d5
BatteryInfo App Redesign using arc (#2236)
Redesign BatteryInfo App using an Arch widget instead of a bar.

The colors I used are as follows:
- Discharging (default): green
- Charging: lime
- Battery full: blue
- Battery low (<10%): red
2025-03-14 13:07:46 +01:00
Steveis 728da0f4a0
Fix Infineat crash when charging with AOD (#2256)
Optimise the battery animation to not use 100% CPU (which causes DisplayApp to spin forever with AOD)
(DisplayApp also needs to be fixed in the future so it cannot spin infinitely)
2025-02-26 23:16:20 +00:00
Titus d371ebc9e2
Improve no notification text (#2238)
Change the "No notification" text to "No notifications"
2025-02-10 19:28:20 +00:00
ljahn dbe8820834
Alarm: Simplify alarm alerting screen (#2211)
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
2025-01-21 09:10:41 +01:00
Jozef Mlich 3e23ee7c78 Show alarm controller state in status icon 2025-01-05 14:37:35 +01:00
Victor Kareh d69cfcfb13 weather: Fix inverted imperial forecast temperatures
When converting to imperial units, the min and max temperatures were
incorrectly inverted, causing confusion in the display.

Fixes https://github.com/InfiniTimeOrg/InfiniTime/issues/2183
2024-12-10 00:02:17 +01:00
Felipe Martínez b8c51abe69
Use all free RAM for FreeRTOS heap
* Use all free RAM for FreeRTOS heap
* Wrap newlib malloc and related functions
* Implement calloc
2024-12-09 00:10:09 +00:00
Lionel Elie Mamane 79ee886904 spelling 2024-11-25 08:55:37 +01:00
Lionel Elie Mamane b1d70ae2ed remove unused include 2024-11-25 08:55:37 +01:00
xz-dev a77a3dcb8b cmake: fix python path with use multi-version python 2024-11-17 23:36:22 +00:00
mark9064 8aefa3b9a6 Ignore old GoToRunning messages 2024-11-17 15:35:15 +01:00
Lionel Elie Mamane 5ea9c5537e Weather: fix min and max temperature being switched 2024-11-16 23:53:33 +00:00
FintasticMan f7c87a700d weather: Switch to std::optional for Forecast days
Also only iterate over the number of days actually in use, rather than
MaxNbForecastDays.
2024-11-04 21:22:38 +01:00
FintasticMan e247bd7019 Switch to simpler temperature interface 2024-11-04 21:22:38 +01:00
FintasticMan 29ad09f4ef weather: Refactor temperature type for type safety
There is now a Temperature struct in the weather service, which holds
the internal representation. There is also a temperature struct in the
Applications namespace, which holds the temperature in either Celsius or
Fahrenheit.
2024-11-04 21:22:38 +01:00
Samuel Dorsaz afeded0126 Update Date&Time settings label for "Date & Time" 2024-11-04 21:20:44 +01:00
mark9064 57b6db8b2a Remove OnTouchEvent 2024-10-27 19:51:01 +01:00
mark9064 0076962588 Unify touch panel handling 2024-10-27 19:51:01 +01:00
mark9064 e6ee548536 Process touch events only when awake 2024-10-27 19:51:01 +01:00
mark9064 1808634f0e Clear ongoing taps when going to sleep 2024-10-27 19:51:01 +01:00
Lionel Elie Mamane cfaad261dc SimpleWeatherService #include <array>
not <vector> as that is what is actually used.
Fixes build failure
InfiniTime/src/components/ble/SimpleWeatherService.h:86:18: error: field ‘location’ has incomplete type ‘Pinetime::Controllers::SimpleWeatherService::Location’ {aka ‘std::array<char, 33>’
2024-10-27 18:27:03 +01:00
FintasticMan f1651c8000 datetime: Set the default year to the year during compile 2024-10-27 17:01:07 +01:00
mark9064 8a2ee437f5 Restrict hardware reactivation when not sleeping 2024-10-27 16:56:47 +01:00
mark9064 06b721a71f Improve sleep time calculation docs 2024-10-27 16:56:47 +01:00
mark9064 771008495e Replace rounded div macro 2024-10-27 16:56:47 +01:00
mark9064 f032847ae1 Refactor into defined states 2024-10-27 16:56:47 +01:00
mark9064 97ba39988b 8hz idle 2024-10-27 16:56:47 +01:00
NeroBurner 8598142c27
Remove unused submodule QCBOR (#2138)
The submodule isn't used anymore. Remove the submodule reference
completely.
2024-10-09 20:26:08 +02:00
NeroBurner a2356f2f4a
MusicService: add missing includes for TickType_t and xTaskGetTickCount (#2130)
Add `FreeRTOS.h` include for the directly used data type `TickType_t` in the header
and the function `xTaskGetTickCount` from FreeRTOS's `task.h`
2024-09-29 21:10:32 +02:00
NeroBurner 3db4e012ce
Remove unused pointer to DisplayApp member variables (#2125)
In the screens that use `DisplayApp *app` and pass it to a child item,
or use the reference just in the constructor. Afterwards the `app`
member is not used. So remove it from the private member variables.

Completely remove `app` parameter from `SettingDisplay` constructor as
it is unused.
2024-09-29 19:39:14 +02:00
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
Reinhold Gschweicher 997e4cee8c Hrs3300: fix includes for std::begin/std::end
Fix for Hrs3300 PR about Atomic HRS reads:
https://github.com/InfiniTimeOrg/InfiniTime/pull/1845

We use `std::begin` and `std::end`, but we don't include one of the
headers that define those functions.
See https://en.cppreference.com/w/cpp/iterator/begin for a list of
headers that define `std::begin` and `std::end`.

Starting with GCC 14 this leads to a compilation error presumably
because they cleaned up their headers.

Fix code by inlcuding `<iterator>`
2024-09-22 16:15:48 +02:00
mark9064 ad3bf49c7b
Atomic HRS reads (#1845)
- Combine the reading of all `HRS3300` registers into one I2C read so data is not partial
- Downsizes both HRS and ALS to 16bit as the sensor does not generate larger than
  16bit values in its current configuration
  - Increasing the resolution by 1 bit doubles the sensor acquisition time,
    since we are already at 10Hz we are never going to use a higher resolution
  - The PPG algorithm buffers for ALS/HRS are already 16bit anyway
- Remove functions for setting gain / drive that are unused throughout the codebase
- Calculate constants with constexpr
2024-09-22 00:29:15 +02:00
mark9064 7ca0418c82 Refactor doNotGoToSleep to a wakelock counter 2024-09-21 22:45:57 +02:00
mark9064 c3d05901a0 Refactor SystemTask state handling for resilience
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
2024-09-21 21:08:07 +02:00
mark9064 b3756e45fa Remove unused method declarations 2024-09-21 21:08:07 +02:00