summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy6
-rw-r--r--README.md3
-rw-r--r--doc/buildAndProgram.md1
-rw-r--r--doc/contribute.md53
-rw-r--r--doc/gettingStarted/appmenu-071.jpgbin0 -> 109376 bytes
-rw-r--r--doc/gettingStarted/appmenu.jpgbin0 -> 120674 bytes
-rw-r--r--doc/gettingStarted/bootloader-1.0.jpgbin0 -> 160275 bytes
-rw-r--r--doc/gettingStarted/gettingStarted-1.0.md112
-rw-r--r--doc/gettingStarted/oldbootloaderlogo.jpgbin0 -> 116236 bytes
-rw-r--r--doc/gettingStarted/ota-gadgetbridge-nrfconnect.md (renamed from doc/gettingStarted/gettingStarted.md)0
-rw-r--r--doc/gettingStarted/quickactions.jpgbin0 -> 114900 bytes
-rw-r--r--doc/gettingStarted/settings.jpgbin0 -> 130022 bytes
-rw-r--r--doc/gettingStarted/version-071.jpgbin0 -> 111556 bytes
-rw-r--r--doc/gettingStarted/version-1.0.jpgbin0 -> 116881 bytes
-rw-r--r--src/components/heartrate/Ppg.cpp10
-rw-r--r--src/components/heartrate/Ppg.h6
-rw-r--r--src/displayapp/DisplayApp.cpp45
-rw-r--r--src/displayapp/DisplayApp.h5
-rw-r--r--src/displayapp/DisplayAppRecovery.cpp8
-rw-r--r--src/displayapp/DisplayAppRecovery.h2
-rw-r--r--src/displayapp/fonts/README.md6
-rw-r--r--src/displayapp/screens/Navigation.cpp2
-rw-r--r--src/displayapp/screens/StopWatch.cpp3
-rw-r--r--src/displayapp/screens/SystemInfo.cpp6
-rw-r--r--src/displayapp/screens/WatchFaceDigital.cpp17
-rw-r--r--src/displayapp/screens/settings/QuickSettings.cpp3
-rw-r--r--src/displayapp/screens/settings/QuickSettings.h3
m---------src/libs/lvgl0
-rw-r--r--src/logging/NrfLogger.cpp5
-rw-r--r--src/systemtask/SystemTask.cpp1
-rw-r--r--tools/bin2c.py4
31 files changed, 234 insertions, 67 deletions
diff --git a/.clang-tidy b/.clang-tidy
index d6036802..8a7d38f0 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -22,5 +22,9 @@ Checks: '*,
-hicpp-no-assembler,
-hicpp-avoid-c-arrays,
-hicpp-uppercase-literal-suffix,
+ -hicpp-no-array-decay,
-cert-err58-cpp,
- -cert-err60-cpp' \ No newline at end of file
+ -cert-err60-cpp'
+CheckOptions:
+ - key: readability-function-cognitive-complexity.Threshold
+ value: 100 \ No newline at end of file
diff --git a/README.md b/README.md
index 34f6e841..396d7462 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,8 @@ As of now, here is the list of achievements of this project:
## Documentation
### Getting started
- - [Flash, upgrade (OTA), time synchronization,...](doc/gettingStarted/gettingStarted.md)
+ - [Getting started with InfiniTime 1.0 (quick user guide, update bootloader and InfiniTime,...)](doc/gettingStarted/gettingStarted-1.0.md)
+ - [Flash, upgrade (OTA), time synchronization,...](doc/gettingStarted/ota-gadgetbridge-nrfconnect.md)
### Develop
- [Generate the fonts and symbols](src/displayapp/fonts/README.md)
diff --git a/doc/buildAndProgram.md b/doc/buildAndProgram.md
index cf349094..afd526e0 100644
--- a/doc/buildAndProgram.md
+++ b/doc/buildAndProgram.md
@@ -3,6 +3,7 @@
To build this project, you'll need:
- A cross-compiler : [ARM-GCC (9-2020-q2-update)](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads/9-2020-q2-update)
- The NRF52 SDK 15.3.0 : [nRF-SDK v15.3.0](https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip)
+ - The `cbor` and `intelhex` modules for Python 3
- A reasonably recent version of CMake (I use 3.16.5)
## Build steps
diff --git a/doc/contribute.md b/doc/contribute.md
index fe385125..09d20774 100644
--- a/doc/contribute.md
+++ b/doc/contribute.md
@@ -2,37 +2,68 @@
## Report bugs
You use your Pinetime and find a bug in the firmware? [Create an issue on Github](https://github.com/JF002/InfiniTime/issues) explaining the bug, how to reproduce it, the version of the firmware you use...
## Write and improve documentation
-Documentation might be incomplete, or not clear enough, and it is always possible to improve it with better wording, pictures, photo, video,...
+Documentation might be incomplete, or not clear enough, and it is always possible to improve it with better wording, pictures, photo, video,...
As the documentation is part of the source code, you can submit your improvements to the documentation by submitting a pull request (see below).
## Fix bugs, add functionalities and improve the code
You want to fix a bug, add a cool new functionality or improve the code? See *How to submit a pull request below*.
## Spread the word
-Pinetime is a cool open source project that deserves to be know. Talk about it around you, on social networks, on your blog,... and let people know that we are working on an open-source firmware for a smartwatch!
+The Pinetime is a cool open source project that deserves to be known. Talk about it around you, on social networks, on your blog,... and let people know that we are working on an open-source firmware for a smartwatch!
# How to submit a pull request ?
-Your contribution is more than welcome!
-If you want to fix a bug, add a functionality or improve the code, you'll first need to create a branch from the **develop** branch (see [this page about the branching model](./branches.md)). This branch is called a feature branch, and you should choose a name that explains what you are working on (ex: "add-doc-about-contributions"). In this branch, try to focus on only one topic, bug or feature. For example, if you created this branch to work on the UI of a specific application, do not commit modifications about the SPI driver. If you want to work on multiple topics, create one branch per topic.
+## TL;DR
+ - Create a branch from develop;
+ - Work on a single subject in this branch. Create multiple branches/pulls-requests if you want to work on multiple subjects (bugs, features,...);
+ - Test your modifications on the actual hardware;
+ - Check the code formatting against our coding conventions and [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy);
+ - Clean your code and remove files that are not needed;
+ - Write documentation related to your new feature is applicable;
+ - Create the pull-request and write a great description about it : what does your PR do, why, how,... Add pictures and video if possible;
+ - Wait for someone to review your PR and take part in the review process;
+ - Your PR will eventually be merged :)
-When your feature branch is ready, make sure it actually works and do not forget to write documentation about it if necessary.
+Your contribution is more than welcome!
-Then, you can submit a pull-request for review. Try to describe your pull request as much as possible: what did you do in this branch, how does it work, how is it designed, are there any limitations,... This will help the contributors to understand and review your code easily.
+If you want to fix a bug, add a functionality or improve the code, you'll first need to create a branch from the **develop** branch (see [this page about the branching model](./branches.md)). This branch is called a feature branch, and you should choose a name that explains what you are working on (ex: "add-doc-about-contributions"). In this branch, **focus on only one topic, bug or feature**. For example, if you created this branch to work on the UI of a specific application, do not commit modifications about the SPI driver. If you want to work on multiple topics, create one branch per topic.
-Other contributors can post comments about the pull request, maybe ask for more info or adjustements in the code.
+When your feature branch is ready, **make sure it actually works** and **do not forget to write documentation** about it if it's relevant.
-Once the pull request is reviewed an accepted, it'll be merge in **develop** and will be released in the next release version of the firmware.
+I **strongly discourage to create a PR containing modifications that haven't been tested**. If, for any reason, you cannot test your modifications but want to publish them anyway, **please mention it in the description**. This way, other contributors might be willing to test it and provide feedback about your code.
+
+Also, before submitting your PR, check the coding style of your code against the **coding conventions** detailed below. This project also provides [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy) configuration files. You can use them to ensure correct formatting of your code.
+
+Do not forget to check the files you are going to commit and remove those who are not necessary (config files from your IDE, for example). Remove old comments, commented code,...
+
+Then, you can submit a pull-request for review. Try to **describe your pull request as much as possible**: what did you do in this branch, how does it work, how is it designed, are there any limitations,... This will help the contributors to understand and review your code easily. You can add pictures and video to the description so that contributors will have a quick overview of your work.
+
+Other contributors can post comments about the pull request, maybe ask for more info or adjustments in the code.
+
+Once the pull request is reviewed and accepted, it'll be merge in **develop** and will be released in the next release version of the firmware.
+
+## Why all these rules?
+Reviewing pull-requests is a **very time consuming task** for the creator of this project ([JF002](https://github.com/JF002)) and for other contributors who take the time to review them. Every little thing you do to make their lives easier will **increase the chances your PR will be merge quickly**.
+
+When reviewing PR, the author and contributors will first look at the **description**. If it's easy to understand what the PR does, why the modification is needed or interesting and how it's done, a good part of the work is already done : we understand the PR and its context.
+
+Then, reviewing **a few files that were modified for a single purpose** is a lot more easier than to review 30 files modified for many reasons (bug fix, UI improvements, typos in doc,...), even if all these changes make sense. Also, it's possible that we agree on some modification but not on some other, and we won't be able to merge the PR because of the changes that are not accepted.
+
+We do our best to keep the code as consistent as possible, and that mean we pay attention to the **formatting** of the code. If the code formatting is not consistent with our code base, we'll ask you to review it, which will take more time.
+
+The last step of the review consists in **testing** the modification. If it doesn't work out of the box, we'll ask your to review your code and to ensure that it works as expected.
+
+It's totally normal for a PR to need some more work even after it was created, that's why we review them. But every round trip takes time, and it's good practice to try to reduce them as much as possible by following those simple rules.
# Coding convention
## Language
The language of this project is **C++**, and all new code must be written in C++. (Modern) C++ provides a lot of useful tools and functionalities that are beneficial for embedded software development like `constexpr`, `template` and anything that provides zero-cost abstraction.
-It's OK to include C code if this code comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK.
+It's OK to include C code if this code comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK.
## Coding style
-The most important rule to follow is to try to keep the code as easy to read and maintain as possible.
+The most important rule to follow is to try to keep the code as easy to read and maintain as possible.
- - **Identation** : 2 spaces, no tabulation
+ - **Indentation** : 2 spaces, no tabulation
- **Opening brace** at the end of the line
- **Naming** : Choose self-describing variable name
- **class** : PascalCase
diff --git a/doc/gettingStarted/appmenu-071.jpg b/doc/gettingStarted/appmenu-071.jpg
new file mode 100644
index 00000000..dee7c8f6
--- /dev/null
+++ b/doc/gettingStarted/appmenu-071.jpg
Binary files differ
diff --git a/doc/gettingStarted/appmenu.jpg b/doc/gettingStarted/appmenu.jpg
new file mode 100644
index 00000000..1e52fe78
--- /dev/null
+++ b/doc/gettingStarted/appmenu.jpg
Binary files differ
diff --git a/doc/gettingStarted/bootloader-1.0.jpg b/doc/gettingStarted/bootloader-1.0.jpg
new file mode 100644
index 00000000..7b639184
--- /dev/null
+++ b/doc/gettingStarted/bootloader-1.0.jpg
Binary files differ
diff --git a/doc/gettingStarted/gettingStarted-1.0.md b/doc/gettingStarted/gettingStarted-1.0.md
new file mode 100644
index 00000000..2ac22b97
--- /dev/null
+++ b/doc/gettingStarted/gettingStarted-1.0.md
@@ -0,0 +1,112 @@
+# Getting started with InfiniTime 1.0
+On April 22 2021, InfiniTime and Pine64 [announced the release of InfiniTime 1.0](https://www.pine64.org/2021/04/22/its-time-infinitime-1-0/) and the availability of PineTime smartwatches as *enthusiast grade end-user product*. This page aims to guide you with your first step with your new PineTime.
+
+## Firmware, InfiniTime, Bootloader, Recovery firmware, OTA, DFU... What is it?
+You might have already seen these words by reading the announcement, release notes, or [the wiki guide](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0) and, you may find them misleading if you're not familiar with the project.
+
+Basically, a **firmware** is just a software running on the embedded hardware of a device, the PineTime in this case.
+**InfiniTime** is based on 3 distinct **firmwares**:
+ - **[InfiniTime](https://github.com/JF002/InfiniTime)** itself, this is the *application firmware* running on the PineTime. This is the main firmware which provides most of the functionalities you'll use on a daily basis : bluetooth low-energy (BLE) connectivity, applications, watchfaces,...
+ - **[The bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader)** is responsible for safely applying **updates** of the *application firmware*, reverting them in case of issues and load the recovery firmware when requested.
+ - **The recovery firmware** is a specific *application firmware* than can be loaded by the bootloader on user request. This firmware can be useful in case of serious issue, when the main application firmware cannot perform an OTA update correctly. Currently, this recovery firmware is based on [InfiniTime 0.14.1](https://github.com/JF002/InfiniTime/releases/tag/0.14.1).
+
+**OTA** and **DFU** refer to the update of the firmware over BLE (**B**luetooth **L**ow **E**nergy). **OTA** means **O**ver **T**he **A**ir, this is a functionality that allows the user to update the firmware how their device using a wireless communication like BLE. When we talk about **DFU** (**D**igital **F**irmware **U**pdate), we refer to the file format and protocol used to send the update of the firmware to the watch over-the-air. InfiniTime implement the (legacy) DFU protocol from Nordic Semiconductor (NRF).
+
+## How to check the version of InfiniTime and the bootloader?
+Since September 2020, all PineTimes (devkits or sealed) are flashed using the **[first iteration of the bootloader](https://github.com/lupyuen/pinetime-rust-mynewt/releases/tag/v4.1.7)** and **[InfiniTime 0.7.1](https://github.com/JF002/InfiniTime/releases/tag/0.7.1)**. There was no recovery firmware at that time.
+
+The bootloader only runs when the watch starts (from an empty battery, for example) or after a reset (after a succesful OTA or a manual reset - long push on the button).
+
+You can recognize this first iteration of the bootloader with it greenish **PINETIME** logo.
+
+![Old bootloader logo](oldbootloaderlogo.jpg)
+
+You can check the version of InfiniTime by opening the app *SystemInfo*. For version < 1.0:
+
+![InfiniTime 0.7.1 Application menu](appmenu-071.jpg)
+![InfiniTime 0.7.1 version](version-071.jpg)
+
+And for version >= 1.0 :
+
+![InfiniTime 1.0 version](version-1.0.jpg)
+
+
+PineTime shipped from June 2020 (to be confirmed) will be flashed with the [new version of the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/tag/1.0.0), the [recovery firmware](https://github.com/JF002/InfiniTime/releases/tag/0.14.1) and [InfiniTime 1.0](https://github.com/JF002/InfiniTime/releases/tag/1.0.0).
+
+The bootloader is easily recognizable with it white pine cone that is progressively drawn in green. It also displays its own version on the bottom (1.0.0 as of now).
+
+![Bootloader 1.0](bootloader-1.0.jpg)
+
+## How to update your PineTime?
+To update your PineTime, you can use one of the compatible companion applications. Here are the main ones:
+
+ - **[Amazfish](https://github.com/piggz/harbour-amazfish)** (Desktop Linux, mobile Linux, SailfishOS, runs on the PinebookPro and the Pinephone)
+ - **[Gadgetbridge](https://www.gadgetbridge.org/)** (Android)
+ - **[Siglo](https://github.com/alexr4535/siglo)** (Linux, GTK based)
+ - **NRFConnect** (closed source, Android & iOS).
+
+See [this page](ota-gadgetbridge-nrfconnect.md) for more info about the OTA procedure using Gadgetbrige and NRFCOnnect.
+
+### From InfiniTime 0.7.1 / old bootloader
+If your PineTime is currently running InfiniTime 0.7.1 and the old bootloader, we strongly recommend you update them to more recent version (Bootloader 1.0.0 and InfiniTime 1.0.0 as of now). We also recommend you install the recovery firmware once the bootloader is up-do-date.
+
+Using the companion app of your choice, you'll need to apply the OTA procedure for these 3 firmwares in this sequence (failing to follow this specific order might temporarily or permanently brick your device):
+
+ 1. Flash the latest version of InfiniTime. The file to upload is named **pinetime-mcuboot-app-dfu-x.y.z.zip**. Here is the link to [InfiniTime 1.0](https://github.com/JF002/InfiniTime/releases/download/1.0.0/pinetime-mcuboot-app-dfu-1.0.0.zip).
+ 2. Update the bootloader by applying the OTA procedure with the file named [**reloader-mcuboot.zip** from the repo of the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/download/1.0.0/reloader-mcuboot.zip).
+ 3. Install the recovery firmware by applying the OTA procedure with the file named [**pinetime-mcuboot-recovery-loader-dfu-0.14.1.zip** from the version 0.14.1 of InfiniTime](https://github.com/JF002/InfiniTime/releases/download/0.14.1/pinetime-mcuboot-recovery-loader-dfu-0.14.1.zip).
+
+You'll find more info about this process in [this wiki page](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0). You can also see the procedure in video [here](https://video.codingfield.com/videos/watch/831077c5-16f3-47b4-9b2b-c4bbfecc6529) and [here (from Amazfish)](https://video.codingfield.com/videos/watch/f7bffb3d-a6a1-43c4-8f01-f4aeff4adf9e)
+
+### From version > 1.0
+If you are already running the new "1.0.0" bootloader, all you have to do is update your version of InfiniTime when it'll be available. We'll write specific instructions when (if) we release a new version of the bootloader.
+
+### Firmware validation
+The bootloader requires a (manual) validation of the firmware. If the watch reset with an updated firmware that was not validated, the bootloader will consider it as non-functionning and will revert to the previous version of the firmware. This is a safety feature to prevent bricking your device with a faulty firmware.
+
+You can validate your updated firmware on InfiniTime >= 1.0 by following this simple procedure:
+
+ - From the watchface, swipe **right** to display the *Quick Actions menu*
+ - Open the **Settings** app by tapping the *gear* icon on the bottom right
+ - Swipe down and tap on the entry named **Firmware**
+ - This app shows the version that is currently running. If it's not validated yet, it displays 2 buttons:
+ - **Validate** to validate your firmware
+ - **Reset** to reset the watch and revert to the previously running version of the firmware
+
+## InfiniTime 1.0 quick user guide
+### Setting the time
+By default, InfiniTime starts on the digital watchface. It'll probably display the epoch time (1 Jan 1970, 00:00). The time will be automatically synchronized once you connect on of the companion app to your PineTime using BLE connectivity. InfiniTime does not provide any way to manually set the time for now.
+
+### Navigation in the menu
+
+![Quick actions](quickactions.jpg)
+![Settings](settings.jpg)
+![Application menu](appmenu.jpg)
+
+ - Swipe **down** to display the notification panel. Notification sent by your companion app will be displayed in this panel.
+ - Swipe **up** to display the application menus. Apps (stopwatch, music, step, games,...) can be started from this menu.
+ - Swipe **right** to display the Quick Actions menu. This menu allows you to
+ - Set the brightness of the display
+ - Start the **flashlight** app
+ - Enable/disable vibrations on notifications (Do Not Disturb mode)
+ - Enter the **settings** menu
+ - Settings
+ - Display timeout
+ - Wake up event (Tap, wrist rotation)
+ - Time format (12/24H)
+ - Default watchface (digital / analog)
+ - Battery info
+ - Firmware validation
+ - About (system info, firmware version,...)
+
+### Bootloader
+
+Most of the time, the bootloader just runs without your intervention (update and load the firmware).
+
+However, you can enable 2 functionalities using the push button:
+
+ - Push the button until the pine cone is drawn in **blue** to force the rollback of the previous version of the firmware, even if you've already validated the updated one
+ - Push the button until the pine cone is drawn in **red** to load the recovery firmware. This recovery firmware only provides BLE connectivity and OTA functionality.
+
+More info about the bootloader in [its project page](https://github.com/JF002/pinetime-mcuboot-bootloader/blob/master/README.md).
+
diff --git a/doc/gettingStarted/oldbootloaderlogo.jpg b/doc/gettingStarted/oldbootloaderlogo.jpg
new file mode 100644
index 00000000..b4d0cdfb
--- /dev/null
+++ b/doc/gettingStarted/oldbootloaderlogo.jpg
Binary files differ
diff --git a/doc/gettingStarted/gettingStarted.md b/doc/gettingStarted/ota-gadgetbridge-nrfconnect.md
index 1187a9b7..1187a9b7 100644
--- a/doc/gettingStarted/gettingStarted.md
+++ b/doc/gettingStarted/ota-gadgetbridge-nrfconnect.md
diff --git a/doc/gettingStarted/quickactions.jpg b/doc/gettingStarted/quickactions.jpg
new file mode 100644
index 00000000..0d92b134
--- /dev/null
+++ b/doc/gettingStarted/quickactions.jpg
Binary files differ
diff --git a/doc/gettingStarted/settings.jpg b/doc/gettingStarted/settings.jpg
new file mode 100644
index 00000000..510b29eb
--- /dev/null
+++ b/doc/gettingStarted/settings.jpg
Binary files differ
diff --git a/doc/gettingStarted/version-071.jpg b/doc/gettingStarted/version-071.jpg
new file mode 100644
index 00000000..bc9bc5b5
--- /dev/null
+++ b/doc/gettingStarted/version-071.jpg
Binary files differ
diff --git a/doc/gettingStarted/version-1.0.jpg b/doc/gettingStarted/version-1.0.jpg
new file mode 100644
index 00000000..bcfc8c63
--- /dev/null
+++ b/doc/gettingStarted/version-1.0.jpg
Binary files differ
diff --git a/src/components/heartrate/Ppg.cpp b/src/components/heartrate/Ppg.cpp
index 578e2895..da0789e0 100644
--- a/src/components/heartrate/Ppg.cpp
+++ b/src/components/heartrate/Ppg.cpp
@@ -11,7 +11,7 @@ using namespace Pinetime::Controllers;
/** Original implementation from wasp-os : https://github.com/daniel-thompson/wasp-os/blob/master/wasp/ppg.py */
namespace {
- int Compare(int* d1, int* d2, size_t count) {
+ int Compare(int8_t* d1, int8_t* d2, size_t count) {
int e = 0;
for (size_t i = 0; i < count; i++) {
auto d = d1[i] - d2[i];
@@ -20,11 +20,11 @@ namespace {
return e;
}
- int CompareShift(int* d, int shift, size_t count) {
+ int CompareShift(int8_t* d, int shift, size_t count) {
return Compare(d + shift, d, count - shift);
}
- int Trough(int* d, size_t size, float mn, float mx) {
+ int Trough(int8_t* d, size_t size, uint8_t mn, uint8_t mx) {
auto z2 = CompareShift(d, mn - 2, size);
auto z1 = CompareShift(d, mn - 1, size);
for (int i = mn; i < mx + 1; i++) {
@@ -45,13 +45,13 @@ Ppg::Ppg(float spl)
lpf {0.11595249, 0.23190498, 0.11595249, -0.72168143, 0.18549138} {
}
-int Ppg::Preprocess(float spl) {
+int8_t Ppg::Preprocess(float spl) {
spl -= offset;
spl = hpf.Step(spl);
spl = agc.Step(spl);
spl = lpf.Step(spl);
- auto spl_int = static_cast<int>(spl);
+ auto spl_int = static_cast<int8_t>(spl);
if (dataIndex < 200)
data[dataIndex++] = spl_int;
diff --git a/src/components/heartrate/Ppg.h b/src/components/heartrate/Ppg.h
index 6a2fcf18..ee07dfcf 100644
--- a/src/components/heartrate/Ppg.h
+++ b/src/components/heartrate/Ppg.h
@@ -10,14 +10,14 @@ namespace Pinetime {
public:
explicit Ppg(float spl);
- int Preprocess(float spl);
+ int8_t Preprocess(float spl);
float HeartRate();
void SetOffset(uint16_t i);
void Reset();
private:
- std::array<int, 200> data;
+ std::array<int8_t, 200> data;
size_t dataIndex = 0;
float offset;
Biquad hpf;
@@ -27,4 +27,4 @@ namespace Pinetime {
float ProcessHeartRate();
};
}
-} \ No newline at end of file
+}
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index 3e25ec83..cc1f6b6c 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -7,6 +7,7 @@
#include "components/datetime/DateTimeController.h"
#include "components/ble/NotificationManager.h"
#include "components/motion/MotionController.h"
+#include "components/motor/MotorController.h"
#include "displayapp/screens/ApplicationList.h"
#include "displayapp/screens/Brightness.h"
#include "displayapp/screens/Clock.h"
@@ -53,6 +54,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
Pinetime::Controllers::NotificationManager& notificationManager,
Pinetime::Controllers::HeartRateController& heartRateController,
Controllers::Settings& settingsController,
+ Pinetime::Controllers::MotorController& motorController,
Pinetime::Controllers::MotionController& motionController)
: lcd {lcd},
lvgl {lvgl},
@@ -65,6 +67,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
notificationManager {notificationManager},
heartRateController {heartRateController},
settingsController {settingsController},
+ motorController {motorController},
motionController {motionController} {
msgQueue = xQueueCreate(queueSize, itemSize);
// Start clock when smartwatch boots
@@ -72,8 +75,9 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
}
void DisplayApp::Start() {
- if (pdPASS != xTaskCreate(DisplayApp::Process, "displayapp", 800, this, 0, &taskHandle))
+ if (pdPASS != xTaskCreate(DisplayApp::Process, "displayapp", 800, this, 0, &taskHandle)) {
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
+ }
}
void DisplayApp::Process(void* instance) {
@@ -84,7 +88,7 @@ void DisplayApp::Process(void* instance) {
// Send a dummy notification to unlock the lvgl display driver for the first iteration
xTaskNotifyGive(xTaskGetCurrentTaskHandle());
- while (1) {
+ while (true) {
app->Refresh();
}
}
@@ -212,7 +216,7 @@ void DisplayApp::StartApp(Apps app, DisplayApp::FullRefreshDirections direction)
LoadApp(app, direction);
}
-void DisplayApp::returnApp(Apps app, DisplayApp::FullRefreshDirections direction, TouchEvents touchEvent) {
+void DisplayApp::ReturnApp(Apps app, DisplayApp::FullRefreshDirections direction, TouchEvents touchEvent) {
returnToApp = app;
returnDirection = direction;
returnTouchEvent = touchEvent;
@@ -223,12 +227,12 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
SetFullRefresh(direction);
// default return to launcher
- returnApp(Apps::Launcher, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ ReturnApp(Apps::Launcher, FullRefreshDirections::Down, TouchEvents::SwipeDown);
switch (app) {
case Apps::Launcher:
currentScreen = std::make_unique<Screens::ApplicationList>(this, settingsController, batteryController, dateTimeController);
- returnApp(Apps::Clock, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ ReturnApp(Apps::Clock, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::None:
case Apps::Clock:
@@ -244,7 +248,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
case Apps::FirmwareValidation:
currentScreen = std::make_unique<Screens::FirmwareValidation>(this, validator);
- returnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::FirmwareUpdate:
currentScreen = std::make_unique<Screens::FirmwareUpdate>(this, bleController);
@@ -253,39 +257,39 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
case Apps::Notifications:
currentScreen = std::make_unique<Screens::Notifications>(
this, notificationManager, systemTask.nimble().alertService(), Screens::Notifications::Modes::Normal);
- returnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp);
+ ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp);
break;
case Apps::NotificationsPreview:
currentScreen = std::make_unique<Screens::Notifications>(
this, notificationManager, systemTask.nimble().alertService(), Screens::Notifications::Modes::Preview);
- returnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp);
+ ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp);
break;
// Settings
case Apps::QuickSettings:
- currentScreen =
- std::make_unique<Screens::QuickSettings>(this, batteryController, dateTimeController, brightnessController, settingsController);
- returnApp(Apps::Clock, FullRefreshDirections::LeftAnim, TouchEvents::SwipeLeft);
+ currentScreen = std::make_unique<Screens::QuickSettings>(
+ this, batteryController, dateTimeController, brightnessController, motorController, settingsController);
+ ReturnApp(Apps::Clock, FullRefreshDirections::LeftAnim, TouchEvents::SwipeLeft);
break;
case Apps::Settings:
currentScreen = std::make_unique<Screens::Settings>(this, settingsController);
- returnApp(Apps::QuickSettings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ ReturnApp(Apps::QuickSettings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::SettingWatchFace:
currentScreen = std::make_unique<Screens::SettingWatchFace>(this, settingsController);
- returnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::SettingTimeFormat:
currentScreen = std::make_unique<Screens::SettingTimeFormat>(this, settingsController);
- returnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::SettingWakeUp:
currentScreen = std::make_unique<Screens::SettingWakeUp>(this, settingsController);
- returnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::SettingDisplay:
currentScreen = std::make_unique<Screens::SettingDisplay>(this, settingsController);
- returnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::SettingSteps:
currentScreen = std::make_unique<Screens::SettingSteps>(this, settingsController);
@@ -293,18 +297,18 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
break;
case Apps::BatteryInfo:
currentScreen = std::make_unique<Screens::BatteryInfo>(this, batteryController);
- returnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::SysInfo:
currentScreen =
std::make_unique<Screens::SystemInfo>(this, dateTimeController, batteryController, brightnessController, bleController, watchdog);
- returnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
//
case Apps::FlashLight:
currentScreen = std::make_unique<Screens::FlashLight>(this, systemTask, brightnessController);
- returnApp(Apps::Clock, FullRefreshDirections::Down, TouchEvents::None);
+ ReturnApp(Apps::Clock, FullRefreshDirections::Down, TouchEvents::None);
break;
case Apps::StopWatch:
currentScreen = std::make_unique<Screens::StopWatch>(this);
@@ -355,8 +359,9 @@ TouchEvents DisplayApp::OnTouchEvent() {
if (info.isTouch) {
switch (info.gesture) {
case Pinetime::Drivers::Cst816S::Gestures::SingleTap:
- if (touchMode == TouchModes::Gestures)
+ if (touchMode == TouchModes::Gestures) {
lvgl.SetNewTapEvent(info.x, info.y);
+ }
return TouchEvents::Tap;
case Pinetime::Drivers::Cst816S::Gestures::LongPress:
return TouchEvents::LongTap;
diff --git a/src/displayapp/DisplayApp.h b/src/displayapp/DisplayApp.h
index ff5ddac8..ffe27cf1 100644
--- a/src/displayapp/DisplayApp.h
+++ b/src/displayapp/DisplayApp.h
@@ -8,6 +8,7 @@
#include "LittleVgl.h"
#include "TouchEvents.h"
#include "components/brightness/BrightnessController.h"
+#include "components/motor/MotorController.h"
#include "components/firmwarevalidator/FirmwareValidator.h"
#include "components/settings/Settings.h"
#include "displayapp/screens/Screen.h"
@@ -51,6 +52,7 @@ namespace Pinetime {
Pinetime::Controllers::NotificationManager& notificationManager,
Pinetime::Controllers::HeartRateController& heartRateController,
Controllers::Settings& settingsController,
+ Pinetime::Controllers::MotorController& motorController,
Pinetime::Controllers::MotionController& motionController);
void Start();
void PushMessage(Display::Messages msg);
@@ -72,6 +74,7 @@ namespace Pinetime {
Pinetime::Controllers::NotificationManager& notificationManager;
Pinetime::Controllers::HeartRateController& heartRateController;
Pinetime::Controllers::Settings& settingsController;
+ Pinetime::Controllers::MotorController& motorController;
Pinetime::Controllers::MotionController& motionController;
Pinetime::Controllers::FirmwareValidator validator;
@@ -100,7 +103,7 @@ namespace Pinetime {
static void Process(void* instance);
void InitHw();
void Refresh();
- void returnApp(Apps app, DisplayApp::FullRefreshDirections direction, TouchEvents touchEvent);
+ void ReturnApp(Apps app, DisplayApp::FullRefreshDirections direction, TouchEvents touchEvent);
void LoadApp(Apps app, DisplayApp::FullRefreshDirections direction);
};
}
diff --git a/src/displayapp/DisplayAppRecovery.cpp b/src/displayapp/DisplayAppRecovery.cpp
index 5c7dd03d..a132a47c 100644
--- a/src/displayapp/DisplayAppRecovery.cpp
+++ b/src/displayapp/DisplayAppRecovery.cpp
@@ -18,6 +18,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
Pinetime::Controllers::NotificationManager& notificationManager,
Pinetime::Controllers::HeartRateController& heartRateController,
Pinetime::Controllers::Settings& settingsController,
+ Pinetime::Controllers::MotorController& motorController,
Pinetime::Controllers::MotionController& motionController)
: lcd {lcd}, bleController {bleController} {
msgQueue = xQueueCreate(queueSize, itemSize);
@@ -36,7 +37,7 @@ void DisplayApp::Process(void* instance) {
xTaskNotifyGive(xTaskGetCurrentTaskHandle());
app->InitHw();
- while (1) {
+ while (true) {
app->Refresh();
}
}
@@ -50,10 +51,11 @@ void DisplayApp::Refresh() {
if (xQueueReceive(msgQueue, &msg, 200)) {
switch (msg) {
case Display::Messages::UpdateBleConnection:
- if (bleController.IsConnected())
+ if (bleController.IsConnected()) {
DisplayLogo(colorBlue);
- else
+ } else {
DisplayLogo(colorWhite);
+ }
break;
case Display::Messages::BleFirmwareUpdateStarted:
DisplayLogo(colorGreen);
diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h
index 025be6c0..30b8e0a1 100644
--- a/src/displayapp/DisplayAppRecovery.h
+++ b/src/displayapp/DisplayAppRecovery.h
@@ -17,6 +17,7 @@
#include <drivers/Watchdog.h>
#include <components/heartrate/HeartRateController.h>
#include <components/motion/MotionController.h>
+#include <components/motor/MotorController.h>
#include <components/settings/Settings.h>
#include "TouchEvents.h"
#include "Apps.h"
@@ -41,6 +42,7 @@ namespace Pinetime {
Pinetime::Controllers::NotificationManager& notificationManager,
Pinetime::Controllers::HeartRateController& heartRateController,
Pinetime::Controllers::Settings& settingsController,
+ Pinetime::Controllers::MotorController& motorController,
Pinetime::Controllers::MotionController& motionController);
void Start();
void PushMessage(Pinetime::Applications::Display::Messages msg);
diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md
index 494654cd..f43e9c52 100644
--- a/src/displayapp/fonts/README.md
+++ b/src/displayapp/fonts/README.md
@@ -22,10 +22,10 @@ Add new symbols:
readme updated with newest range list)
* Convert this hex value into a UTF-8 code
using [this site](http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=f185&mode=hex)
-* Define the new symbols in `src/DisplayApp/Screens/Symbols.h`:
+* Define the new symbols in `src/displayapp/screens/Symbols.h`:
```
-static constex char* newSymbol = "\xEF\x86\x85";
+static constexpr const char* newSymbol = "\xEF\x86\x85";
```
#### Navigation font
@@ -41,4 +41,4 @@ ttf file : navigation.ttf name : lv_font_navi_80 size : 80px Bpp : 2 bit-per-pix
$lv_font_conv --font navigation.ttf -r '0xe900-0xe929' --size 80 --format lvgl --bpp 2 --no-prefilter -o
lv_font_navi_80.c
-#### I use the method above to create the other ttf \ No newline at end of file
+#### I use the method above to create the other ttf
diff --git a/src/displayapp/screens/Navigation.cpp b/src/displayapp/screens/Navigation.cpp
index fe9b5a83..b5ce8b83 100644
--- a/src/displayapp/screens/Navigation.cpp
+++ b/src/displayapp/screens/Navigation.cpp
@@ -40,7 +40,7 @@ Navigation::Navigation(Pinetime::Applications::DisplayApp* app, Pinetime::Contro
txtNarrative = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_long_mode(txtNarrative, LV_LABEL_LONG_BREAK);
lv_obj_set_width(txtNarrative, LV_HOR_RES);
- lv_label_set_text(txtNarrative, "Welcome to navigation!");
+ lv_label_set_text(txtNarrative, "Navigation");
lv_label_set_align(txtNarrative, LV_LABEL_ALIGN_CENTER);
lv_obj_align(txtNarrative, nullptr, LV_ALIGN_CENTER, 0, 10);
diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp
index e06981af..d7cd20c3 100644
--- a/src/displayapp/screens/StopWatch.cpp
+++ b/src/displayapp/screens/StopWatch.cpp
@@ -115,8 +115,9 @@ bool StopWatch::Refresh() {
// Init state when an user first opens the app
// and when a stop/reset button is pressed
case States::Init: {
- if (btnStopLap) {
+ if (btnStopLap != nullptr) {
lv_obj_del(btnStopLap);
+ btnStopLap = nullptr;
}
// The initial default value
lv_label_set_text(time, "00:00");
diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp
index f6e8d61a..ab349d7b 100644
--- a/src/displayapp/screens/SystemInfo.cpp
+++ b/src/displayapp/screens/SystemInfo.cpp
@@ -70,8 +70,8 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
"#FFFF00 InfiniTime#\n\n"
"#444444 Version# %ld.%ld.%ld\n\n"
"#444444 Build date#\n"
- "\t%s\n"
- "\t%s\n",
+ "%s\n"
+ "%s\n",
Version::Major(),
Version::Minor(),
Version::Patch(),
@@ -242,4 +242,4 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen5() {
lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
lv_obj_align(label, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
return std::unique_ptr<Screen>(new Screens::Label(4, 5, app, label));
-} \ No newline at end of file
+}
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp
index bf078d03..f1285eaf 100644
--- a/src/displayapp/screens/WatchFaceDigital.cpp
+++ b/src/displayapp/screens/WatchFaceDigital.cpp
@@ -88,14 +88,9 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
heartbeatValue = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(heartbeatValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
- lv_label_set_text(heartbeatValue, "---");
+ lv_label_set_text(heartbeatValue, "");
lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
- heartbeatBpm = lv_label_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_text_color(heartbeatBpm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
- lv_label_set_text(heartbeatBpm, "BPM");
- lv_obj_align(heartbeatBpm, heartbeatValue, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
-
stepValue = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FFE7));
lv_label_set_text(stepValue, "0");
@@ -226,14 +221,16 @@ bool WatchFaceDigital::Refresh() {
heartbeat = heartRateController.HeartRate();
heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped;
if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
- if (heartbeatRunning.Get())
+ if (heartbeatRunning.Get()) {
+ lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
- else
- lv_label_set_text_static(heartbeatValue, "---");
+ } else {
+ lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x1B1B1B));
+ lv_label_set_text_static(heartbeatValue, "");
+ }
lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 5, -2);
lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
- lv_obj_align(heartbeatBpm, heartbeatValue, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
}
stepCount = motionController.NbSteps();
diff --git a/src/displayapp/screens/settings/QuickSettings.cpp b/src/displayapp/screens/settings/QuickSettings.cpp
index d19e4222..3994794d 100644
--- a/src/displayapp/screens/settings/QuickSettings.cpp
+++ b/src/displayapp/screens/settings/QuickSettings.cpp
@@ -21,11 +21,13 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
Pinetime::Controllers::Battery& batteryController,
Controllers::DateTime& dateTimeController,
Controllers::BrightnessController& brightness,
+ Controllers::MotorController& motorController,
Pinetime::Controllers::Settings& settingsController)
: Screen(app),
batteryController {batteryController},
dateTimeController {dateTimeController},
brightness {brightness},
+ motorController{motorController},
settingsController {settingsController} {
// Time
@@ -138,6 +140,7 @@ void QuickSettings::OnButtonEvent(lv_obj_t* object, lv_event_t event) {
if (lv_obj_get_state(btn3, LV_BTN_PART_MAIN) & LV_STATE_CHECKED) {
settingsController.SetVibrationStatus(Controllers::Settings::Vibration::ON);
+ motorController.SetDuration(35);
lv_label_set_text_static(btn3_lvl, Symbols::notificationsOn);
} else {
settingsController.SetVibrationStatus(Controllers::Settings::Vibration::OFF);
diff --git a/src/displayapp/screens/settings/QuickSettings.h b/src/displayapp/screens/settings/QuickSettings.h
index 8d04bec3..a14f46bf 100644
--- a/src/displayapp/screens/settings/QuickSettings.h
+++ b/src/displayapp/screens/settings/QuickSettings.h
@@ -7,6 +7,7 @@
#include <lvgl/lvgl.h>
#include "components/datetime/DateTimeController.h"
#include "components/brightness/BrightnessController.h"
+#include "components/motor/MotorController.h"
#include "components/settings/Settings.h"
#include "components/battery/BatteryController.h"
@@ -21,6 +22,7 @@ namespace Pinetime {
Pinetime::Controllers::Battery& batteryController,
Controllers::DateTime& dateTimeController,
Controllers::BrightnessController& brightness,
+ Controllers::MotorController& motorController,
Pinetime::Controllers::Settings& settingsController);
~QuickSettings() override;
@@ -36,6 +38,7 @@ namespace Pinetime {
Pinetime::Controllers::Battery& batteryController;
Controllers::DateTime& dateTimeController;
Controllers::BrightnessController& brightness;
+ Controllers::MotorController& motorController;
Controllers::Settings& settingsController;
lv_task_t* taskUpdate;
diff --git a/src/libs/lvgl b/src/libs/lvgl
-Subproject 1b6501dc3babf39538f4a02aa9fb14c2aaebca2
+Subproject 23430cf20e32294549fff9b2879a9466dacc19b
diff --git a/src/logging/NrfLogger.cpp b/src/logging/NrfLogger.cpp
index 70a00e61..1c048f2c 100644
--- a/src/logging/NrfLogger.cpp
+++ b/src/logging/NrfLogger.cpp
@@ -12,8 +12,9 @@ void NrfLogger::Init() {
NRF_LOG_DEFAULT_BACKENDS_INIT();
- if (pdPASS != xTaskCreate(NrfLogger::Process, "LOGGER", 200, this, 0, &m_logger_thread))
+ if (pdPASS != xTaskCreate(NrfLogger::Process, "LOGGER", 200, this, 0, &m_logger_thread)) {
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
+ }
}
void NrfLogger::Process(void*) {
@@ -21,7 +22,7 @@ void NrfLogger::Process(void*) {
// Suppress endless loop diagnostic
#pragma clang diagnostic push
#pragma ide diagnostic ignored "EndlessLoop"
- while (1) {
+ while (true) {
NRF_LOG_FLUSH();
vTaskDelay(100); // Not good for power consumption, it will wake up every 100ms...
}
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp
index 5b03fbbb..6d695e2c 100644
--- a/src/systemtask/SystemTask.cpp
+++ b/src/systemtask/SystemTask.cpp
@@ -115,6 +115,7 @@ void SystemTask::Work() {
notificationManager,
heartRateController,
settingsController,
+ motorController,
motionController);
displayApp->Start();
diff --git a/tools/bin2c.py b/tools/bin2c.py
index 1d66656a..e5fdb158 100644
--- a/tools/bin2c.py
+++ b/tools/bin2c.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#-*- coding: utf-8 -*-
"""
bin2c
@@ -71,4 +71,4 @@ def main():
if __name__ == '__main__':
- main() \ No newline at end of file
+ main()