Commit Graph

170 Commits

Author SHA1 Message Date
Riku Isokoski
09b852d8f0 Fix and test workflow 2022-05-08 22:27:42 +03:00
Jean-François Milants
dedb397ae0 Systemtask : replace enum SystemTaskState by an enum class. 2022-05-08 13:29:02 +02:00
Riku Isokoski
ae2b9d30d6 Simplify systemtask states 2022-05-08 13:24:15 +02:00
Riku Isokoski
b7b1af1c4c Replace app_timer with FreeRTOS timers 2022-04-25 15:52:39 +03:00
Reinhold Gschweicher
2607c3d799 Let TouchHandler return TouchEvents instead of driver specific enum
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`.
2022-04-13 21:33:58 +02:00
Jean-François Milants
f1194a5f74 In current configuration, the timer task (the one from FreeRTOS) has the 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.
2022-03-21 20:53:46 +01:00
Reinhold Gschweicher
187d99c0f7 SystemMonitor: implement FreeRtosMonitor only if trace facility is set
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.
2022-03-08 20:28:54 +01:00
Jean-François Milants
ef44b763d9 Merge branch 'airplane-mode' of https://github.com/evergreen22/InfiniTime 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
2022-02-20 15:40:49 +01:00
Jean-François Milants
40cdb54772 Merge branch 'airplane-mode' of https://github.com/evergreen22/InfiniTime 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
2022-02-20 15:25:24 +01:00
Reinhold Gschweicher
b857fdb9f4 SystemTask: forward declare BatteryController to fix of cyclic dependency
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.
2022-02-19 13:17:00 +01:00
Reinhold Gschweicher
d5b78ecd66 SystemTask: remove unused ble includes
Remove unused includes. The firmware still compiles fine without the
includes.
2022-02-19 13:00:50 +01:00
Reinhold Gschweicher
5938b4b208 SystemTask: fix static cast missing brackets syntax
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)
```
2022-02-12 18:38:31 +01:00
JF
e73a92c29b
Merge pull request #949 from Riksu9000/fix_alarm
Fix alarm on time change
2022-01-26 22:03:14 +01:00
JF
458f5b8eb8
Merge pull request #903 from Riksu9000/improved_notif_timeout
Improved notification timeout
2022-01-26 21:38:07 +01:00
Riku Isokoski
470db4ab99 Fix alarm on time change 2022-01-22 12:47:23 +02:00
Reinhold Gschweicher
bbc5af078d SystemTask: add missing queue.h include for QueueHandle_t 2022-01-16 22:47:16 +01:00
Jean-François Milants
bef3e708f6 Merge branch 'ShakeWake' of https://github.com/geekbozu/InfiniTime into geekbozu-ShakeWake
# Conflicts:
#	src/CMakeLists.txt
#	src/displayapp/Apps.h
#	src/displayapp/DisplayApp.cpp
#	src/displayapp/screens/settings/Settings.cpp
2022-01-04 21:48:08 +01:00
SteveAmor
15c3807a76 Adds enum class for chimes option 2022-01-04 19:32:29 +00:00
Tim Keller
3ebf002f9d Add start of settings app for senstivity.
really just debugging. I want to make it more configurable then high med low.
Position of setting needs a new location...dynamicly adding it currently at the end. Which honestly im fine with.
2022-01-04 01:59:01 +00:00
Tim Keller
ad42cdf120 Cleanup 2022-01-04 01:57:18 +00:00
Tim Keller
d270275bd2 Added Shake to wake 2022-01-04 01:57:18 +00:00
SteveAmor
cc259b6a4a resolves conflicts 2022-01-02 22:27:43 +00:00
Riku Isokoski
5e6868d9eb Improved notification timeout 2022-01-01 16:22:35 +02:00
James A. Jerkins
319030d9e1 Add airplane mode feature
Implements 'Airplane mode' feature to disable and enable bluetooth/ble
Adds airplaneMode as a non-persisted setting
Adds a setting menu for switching airplane mode on and off
Displays an airplane symbol on the Digital watch face and the
    PineTimeStyle watch face when airplane mode is enabled
Always enables bluetooth/ble on boot (disable airplane mode)
Alphabetizes the settings menu options
Style cleanups

Closes #632
2021-12-23 20:30:14 -06:00
Tim Keller
6393a17d74 List Dir works? 2021-12-10 01:18:57 +00:00
Avamander
9db5d64441 Fixed unpopped diagnostic 2021-12-09 21:30:04 +01:00
Avamander
6a442b90a1 Improved format specifiers, bracing, removed C-style casts, whitespace fixes and removed Tiles shadowing 2021-12-09 21:30:04 +01:00
Tim Keller
cd593c3862 Break not return thanks @FintasticMan 2021-12-09 21:15:00 +01:00
Tim Keller
f1fc7ee659 Adjust systemtask to respect doNotGoToSleep. 2021-12-09 21:15:00 +01:00
James A. Jerkins
048ecd41e4 Adjust BLE/LL stacks, style, comments, refactoring
Increase BLE task stack +200 and decrease LL task stack -200
more braces!
2021-12-09 21:14:16 +01:00
James A. Jerkins
150fa3b661 Persist bond between reboots
Save bond information in the FS after a disconnect or encryption change
if the bond is not already stored. The bond is restored on boot enabling
automatic reconnection to a previously bonded central.

Two consecutive watch reboots with the central out of range (or BLE off)
will remove the stored bond from the watch.
2021-12-09 21:14:16 +01:00
James A. Jerkins
62dbcbfc95 Connect and bond with a passkey
This commit adds the following:
    Passkey pairing - passkey is displayed on watch
    Swipe down to clear passkey screen
    Connection encryption
    Connection bonding
    Automatic reconnects to a bonded peripheral
    Trusted device on Android

Note that persisting the bond between reboots is NOT included in
this commit. Therefore, rebooting the watch will cause reconnect failures.
You must delete the bond from the phone to reconnect/pair.
2021-12-09 21:14:16 +01:00
Reinhold Gschweicher
ac7b2da611 Update includes to to be relative to src directory
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.
2021-11-15 22:02:49 +01:00
Jean-François Milants
76c43ebc82 Fix previous commit, call touchPanel.Init() even if we disabled the touch controller boot error. 2021-11-07 20:13:22 +01:00
Jean-François Milants
e6edf21552 Disable the warning that is displayed when the initialization of the touch controller fails, as some users reported that it was displayed when a valid touch controller was installed. 2021-11-07 18:00:34 +01:00
SteveAmor
822b6ae6a0 format changes 2021-11-07 13:12:01 +00:00
SteveAmor
5932391c8b Chimes option 2021-11-07 10:50:33 +00:00
Riku Isokoski
60a717b1a2 Make it so special actions can be input while sleeping, like in #480 2021-10-25 17:45:48 +03:00
Riku Isokoski
887c409b13 Only wake up on press. Fixes issue with longer press and sleep 2021-10-25 17:13:02 +03:00
Riku Isokoski
351c60a131 Return button action instead of pushing messages 2021-10-25 16:57:29 +03:00
Riku Isokoski
b19a2a760b Use enum classes, remove old comment 2021-10-25 13:40:43 +03:00
Riku Isokoski
d5dfa80876 Newer buttonhandler 2021-10-25 12:53:14 +03:00
Jean-François Milants
60a49af886 Add MotionService : expose step count and RAW X/Y/Z values to the host. 2021-10-17 08:23:44 +02:00
Federico Igne
59ce48a3f3 Make new notifications refresh idle timer 2021-10-14 21:21:01 +01:00
Jean-François Milants
6d0e68d626 Merge branch 'update_touch_driver' of git://github.com/Riksu9000/InfiniTime into Riksu9000-update_touch_driver
# Conflicts:
#	src/displayapp/Apps.h
2021-10-10 16:48:45 +02:00
Jean-François Milants
977faebcb8 Remove call to batteryController.Update(); which was replaced by batteryController.MeasureVoltage(). 2021-10-09 21:17:59 +02:00
JF
9a831a6fe4
Merge pull request #715 from hubmartin/gpiote-fix
Fix GPIOTE not calling ISR when button is held during boot
2021-10-09 20:36:49 +02:00
JF
b969272c90
Merge pull request #719 from Riksu9000/improve_battery_reporting
Improve battery percentage calculation and reporting
2021-10-09 20:11:31 +02:00
Riku Isokoski
1777b9dee8 Don't measure and notify percentage on charging event. 2021-10-09 13:39:27 +03:00
hubmartin
98e74a3217 Call also ReloadIdleTimer 2021-10-08 17:01:27 +02:00