Also, removed feature existance cheking (since it now depends on a font,
so may end up being inside (only) a font not being used currently -
which is an allowed usage)
The scrollbar would go out of bounds if DROPDOWN_PART_LIST had uneven
padding. Also enable clip_corner feature to stop the selected item from
overflowing.
When the screen switches, the full screen needs to be refreshed for the
hardware scrolling to work. This was enforced with backgroundLabels, but
is simpler to do with a rounder function.
List.h uses `std::array` as container, but is missing the `<array>`
include. Add it to make the header self contained.
The `memory` include is unused and can be removed.
There is a large step in brightness from level zero to level one.
After experimenting with various ST7789 options, I found that
decreasing VDV to 0x10 (-0.4V) fixes this issue.
The gamma change reduced the average error in brightness, but with the
underlying issue fixed, the gamma change has been reverted.
`SpiNorFlash.h` is a C++ header, but the `Identification` struct is
created in a C style using `typedef struct`. Clang issues a warining
about this discrepancy:
```
In file included from /home/nero/repos/pinetime/InfiniSim/InfiniTime/src/systemtask/SystemTask.cpp:13:
/home/nero/repos/pinetime/InfiniSim/sim/drivers/SpiNorFlash.h:16:21: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
typedef struct __attribute__((packed)) {
^
Identification
/home/nero/repos/pinetime/InfiniSim/sim/drivers/SpiNorFlash.h:17:9: note: type is not C-compatible due to this default member initializer
uint8_t manufacturer = 0;
^~~~~~~~~~~~~~~~~~~~
/home/nero/repos/pinetime/InfiniSim/sim/drivers/SpiNorFlash.h:20:9: note: type is given name 'Identification' for linkage purposes by this typedef declaration
} Identification;
^
1 warning generated.
```
The easy fix is to use a C++ style struct.
Also includes code style fix from Riksu9000
Co-authored-by: Riku Isokoski <riksu9000@gmail.com>
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 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.
We have a comparison like `if (( a == b ))`, which is a parenthesis too
much, which generates the following warning
```
InfiniTime/src/displayapp/screens/Twos.cpp:133:35: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((grid[newRow][newCol].value == grid[oldRow][oldCol].value)) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InfiniTime/src/displayapp/screens/Twos.cpp:133:35: note: remove extraneous parentheses around the comparison to silence this warning
if ((grid[newRow][newCol].value == grid[oldRow][oldCol].value)) {
~ ^ ~
```
Clang warns on `OnTouchEvent()` function, which is overridden, but is
missing the `override` keyword
```
In file included from InfiniTime/src/displayapp/screens/Music.cpp:18:
InfiniTime/src/displayapp/screens/Music.h:43:14: warning: 'OnTouchEvent' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
bool OnTouchEvent(TouchEvents event);
^
```
There are 3 options, but the array-size is set to 2. This leads to
memory corruption in the initialization of the SettingChimes screen when
assigning the third option object pointer.
Found in https://github.com/InfiniTimeOrg/InfiniSim/issues/11
Split SystemMonitor into h and cpp file and move the logging code of the
`Process` function into the cpp file.
Depending of the `configUSE_TRACE_FACILITY` define from
`src/FreeRTOSConfig.h` create either a "FreeRtosMonitor" or a
"DummyMonitor".
Make the `Process()` function non-const, as the FreeRtosMonitor changes
the member variable `lastTick`.
In `SystemTask.h` we then only need to use `SystemMonitor`, without
knowledge of the `configUSE_TRACE_FACILITY` define.
Some components were missing a `nrf_log.h` include. This missing
include was accidentally provided by the SystemMonitor.h header, which
was included by Systemtask.h
For each filesystem interaction be more specific if we want to read from
the file or write to it.
Doing a non-creating read on the loading of the settings file, otherwise
an empty file could be created, and when reading that empty file for the
initial settings I would expect an error (or random data) when reading.
The variable `title` is defined as `const char*`, which means, that
`strchr()` returns a `const char*` as well according to
https://www.cplusplus.com/reference/cstring/strchr/
But in the same line the return value is assigned to a non-const
`char*`, which shouldn't be allowed (error with `-pedantic`).
Because the `lv_label` creates an internal copy of the title sting, just
modify that one instead and replace newline in the copied string.
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
For the simulator I need a way to get to the brightnessController object
and handle the set brightness-levels accoringly.
This is done by the constructor expecting a brightnessController object
instead of initializing one itself
For ease of use the simulator uses a globbing expression to get all
screens source files. This one was picked up as well and lead to a
compilation error.
SystemTask.h included BatteryController.h, and BatteryController.h
included SystemTask.h. If unlucky the class SystemTask isn't created yet
when BatteryController wants to use it.
Fix that cyclic dependency by forward declaring the BatteryController
class and including it in the SystemTask.cpp file, where it is needed.
SettingShakeThreshold.h uses SystemTask, but doesn't include the header.
Fixing that for the simulator.
For consistency make the header include a relative to src include.
The static_cast syntax requires brackets around the input variable. The
implementation worked because the used input are defines, which add the
missing brackets like the following:
```cpp
#define GPIO_PIN_CNF_SENSE_Low (3UL)
```