summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.devcontainer/Dockerfile2
-rw-r--r--.devcontainer/build.sh2
-rw-r--r--.github/ISSUE_TEMPLATE/bug-report.yaml1
-rw-r--r--.github/ISSUE_TEMPLATE/feature-request.yaml1
-rw-r--r--.github/workflows/main.yml8
-rw-r--r--README.md5
-rw-r--r--bootloader/README.md4
-rw-r--r--doc/MemoryAnalysis.md18
-rw-r--r--doc/ble.md242
-rw-r--r--doc/buildAndProgram.md6
-rw-r--r--doc/buildWithDocker.md10
-rw-r--r--doc/code/Apps.md106
-rw-r--r--doc/code/Intro.md42
-rw-r--r--doc/contribute.md2
-rw-r--r--doc/filesInReleaseNotes.md4
-rw-r--r--doc/gettingStarted/gettingStarted-1.0.md12
-rw-r--r--doc/gettingStarted/ota-gadgetbridge-nrfconnect.md2
-rwxr-xr-xdocker/build.sh2
-rw-r--r--src/displayapp/DisplayAppRecovery.h2
-rw-r--r--src/displayapp/screens/Paddle.cpp4
-rw-r--r--src/displayapp/screens/PineTimeStyle.cpp2
-rw-r--r--src/displayapp/screens/SystemInfo.cpp16
-rw-r--r--src/systemtask/SystemTask.cpp13
23 files changed, 452 insertions, 54 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 1dd68f24..46e2facb 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -55,7 +55,7 @@ RUN unzip -q /tmp/nRF5_SDK_15.3.0_59ac345 -d /opt
RUN rm /tmp/nRF5_SDK_15.3.0_59ac345
# McuBoot
# RUN bash -c "source /opt/build.sh; GetMcuBoot;"
-RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git
+RUN git clone https://github.com/mcu-tools/mcuboot.git
RUN pip3 install -r ./mcuboot/scripts/requirements.txt
RUN adduser infinitime
diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh
index 8f0d0fa9..5dcdf91d 100644
--- a/.devcontainer/build.sh
+++ b/.devcontainer/build.sh
@@ -43,7 +43,7 @@ GetGcc() {
}
GetMcuBoot() {
- git clone https://github.com/JuulLabs-OSS/mcuboot.git "$TOOLS_DIR/mcuboot"
+ git clone https://github.com/mcu-tools/mcuboot.git "$TOOLS_DIR/mcuboot"
pip3 install -r "$TOOLS_DIR/mcuboot/scripts/requirements.txt"
}
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml
index efcba56c..f0fb076e 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.yaml
+++ b/.github/ISSUE_TEMPLATE/bug-report.yaml
@@ -1,6 +1,5 @@
name: Bug Report
description: File a bug report
-title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
diff --git a/.github/ISSUE_TEMPLATE/feature-request.yaml b/.github/ISSUE_TEMPLATE/feature-request.yaml
index 092ef909..26e4fa0f 100644
--- a/.github/ISSUE_TEMPLATE/feature-request.yaml
+++ b/.github/ISSUE_TEMPLATE/feature-request.yaml
@@ -1,6 +1,5 @@
name: Feature Request
description: File a feature request
-title: ""
labels: ["feature request"]
body:
- type: markdown
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index bd24359a..3b753a37 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -153,6 +153,14 @@ jobs:
name: pinetime-app.out
path: build/src/pinetime-app*.out
+ #########################################################################################
+ # Make but don't Upload the Recovery Firmware to be sure it builds correctly
+
+ - name: Make pinetime-recovery
+ run: |
+ cd build
+ make pinetime-recovery
+
#########################################################################################
# Finish
diff --git a/README.md b/README.md
index 9b9c3287..6719aa3e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# InfiniTime
-[![Build PineTime Firmware](https://github.com/JF002/InfiniTime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master)](https://github.com/JF002/InfiniTime/actions)
+[![Build PineTime Firmware](https://github.com/InfiniTimeOrg/InfiniTime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master)](https://github.com/InfiniTimeOrg/InfiniTime/actions)
![InfiniTime logo](images/infinitime-logo.jpg "InfiniTime Logo")
@@ -72,7 +72,8 @@ As of now, here is the list of achievements of this project:
## Documentation
### Develop
-
+ - [Rough structure of the code](doc/code/Intro.md)
+ - [How to implement an application](doc/code/Apps.md)
- [Generate the fonts and symbols](src/displayapp/fonts/README.md)
- [Creating a stopwatch in Pinetime(article)](https://pankajraghav.com/2021/04/03/PINETIME-STOPCLOCK.html)
diff --git a/bootloader/README.md b/bootloader/README.md
index c04e0e34..9f99602b 100644
--- a/bootloader/README.md
+++ b/bootloader/README.md
@@ -1,5 +1,5 @@
# About this bootloader
-The [bootloader](https://github.com/lupyuen/pinetime-rust-mynewt/tree/master/libs/pinetime_boot/src) is mostly developed by [Lup Yuen](https://github.com/lupyuen). It is based on [MCUBoot](https://juullabs-oss.github.io/mcuboot/) and [Mynewt](https://mynewt.apache.org/).
+The [bootloader](https://github.com/lupyuen/pinetime-rust-mynewt/tree/master/libs/pinetime_boot/src) is mostly developed by [Lup Yuen](https://github.com/lupyuen). It is based on [MCUBoot](https://www.mcuboot.com) and [Mynewt](https://mynewt.apache.org/).
The goal of this project is to provide a common bootloader for multiple (all?) Pinetime projects. It allows to upgrade the current bootloader and even replace the current application by another one that supports the same bootloader.
@@ -86,7 +86,7 @@ make pinetime-mcuboot-app
The binary is located in *<build directory>/src/pinetime-mcuboot-app.bin*.
-It must me converted into a MCUBoot image using *imgtool.py* from [MCUBoot](https://github.com/JuulLabs-OSS/mcuboot/tree/master/scripts). Simply checkout the project and run the script <mcuboot root>/scripts/imgtool.py with the following command line:
+It must me converted into a MCUBoot image using *imgtool.py* from [MCUBoot](https://github.com/mcu-tools/mcuboot/tree/master/scripts). Simply checkout the project and run the script <mcuboot root>/scripts/imgtool.py with the following command line:
`
imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header <build directory>/src/pinetime-mcuboot-app.bin image.bin
diff --git a/doc/MemoryAnalysis.md b/doc/MemoryAnalysis.md
index 3251c98d..7304e3f3 100644
--- a/doc/MemoryAnalysis.md
+++ b/doc/MemoryAnalysis.md
@@ -6,7 +6,7 @@ The PineTime is equipped with the following memories:
Note that the NRF52832 cannot execute code stored in the external flash : we need to store the whole firmware in the internal flash memory, and use the external one to store graphicals assets, fonts...
-This document describes how the RAM and Flash memories are used in InfiniTime and how to analyze and monitor their usage. It was written in the context of [this memory analysis effort](https://github.com/JF002/InfiniTime/issues/313).
+This document describes how the RAM and Flash memories are used in InfiniTime and how to analyze and monitor their usage. It was written in the context of [this memory analysis effort](https://github.com/InfiniTimeOrg/InfiniTime/issues/313).
## Code sections
A binary is composed of multiple sections. Most of the time, these sections are : .text, .rodata, .data and .bss but more sections can be defined in the linker script.
@@ -38,7 +38,7 @@ In this analysis, I used [Linkermapviz](https://github.com/PromyLOPh/linkermapvi
Using this tool, you can easily see the size of each symbol relative to the other one, and check what is using most of the space,...
-Also, as Linkermapviz is written in Python, you can easily modify it to adapt it to your firmware, export data in another format,... For example, [I modified it to parse the contents of the MAP file and export it in a CSV file](https://github.com/JF002/InfiniTime/issues/313#issuecomment-842338620). I could later on open this file in LibreOffice Calc and use sort/filter functionality to search for specific symbols in specific files...
+Also, as Linkermapviz is written in Python, you can easily modify it to adapt it to your firmware, export data in another format,... For example, [I modified it to parse the contents of the MAP file and export it in a CSV file](https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-842338620). I could later on open this file in LibreOffice Calc and use sort/filter functionality to search for specific symbols in specific files...
### Puncover
[Puncover](https://github.com/HBehrens/puncover) is another useful tools that analyses the binary file generated by the compiler (the .out file that contains all debug information). It provides valuable information about the symbols (data and code): name, position, size, max stack of each functions, callers, callees...
@@ -69,8 +69,8 @@ This way, you can easily check what needs to be optimized : we should find a way
It's always a good idea to check the flash memory space when working on the project : this way, you can easily check that your developments are using a reasonable amount of space.
### Links
- - Analysis with linkermapviz : https://github.com/JF002/InfiniTime/issues/313#issuecomment-842338620
- - Analysis with Puncover : https://github.com/JF002/InfiniTime/issues/313#issuecomment-847311392
+ - Analysis with linkermapviz : https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-842338620
+ - Analysis with Puncover : https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-847311392
## RAM
RAM memory contains all the data that can be modified at run-time: variables, stack, heap...
@@ -93,7 +93,7 @@ int main() {
In Infinitime 1.1, the biggest buffers are the buffers allocated for LVGL (14KB) and the one for FreeRTOS (16KB). Nimble also allocated 9KB of RAM.
### Stack
-The stack will be used for everything except tasks, which have their own stack allocated by FreeRTOS. The stack is 8192B and is allocated in the [linker script](https://github.com/JF002/InfiniTime/blob/develop/nrf_common.ld#L148).
+The stack will be used for everything except tasks, which have their own stack allocated by FreeRTOS. The stack is 8192B and is allocated in the [linker script](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/nrf_common.ld#L148).
An easy way to monitor its usage is by filling the section with a known pattern at boot time, then use the firmware and dump the memory. You can then check the maximum stack usage by checking the address from the beginning of the stack that were overwritten.
#### Fill the stack section by a known pattern:
@@ -197,10 +197,10 @@ On the following dump, the maximum stack usage is 520 bytes (0xFFFF - 0xFDF8):
According to my experimentations, we don't use the stack that much, and 8192 bytes is probably way too big for InfiniTime!
#### Links
- - https://github.com/JF002/InfiniTime/issues/313#issuecomment-851035070
+ - https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-851035070
### Heap
-The heap is declared in the [linker script](https://github.com/JF002/InfiniTime/blob/develop/nrf_common.ld#L136) and its current size is 8192 bytes. The heap is used for dynamic memory allocation(`malloc()`, `new`...).
+The heap is declared in the [linker script](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/nrf_common.ld#L136) and its current size is 8192 bytes. The heap is used for dynamic memory allocation(`malloc()`, `new`...).
Heap monitoring is not easy, but it seems that we can use the following code to know the current usage of the heap:
@@ -239,7 +239,7 @@ Using this technique, I was able to trace all malloc calls at boot (boot -> digi
- hr task = 304
#### Links
- - https://github.com/JF002/InfiniTime/issues/313#issuecomment-851035625
+ - https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-851035625
- https://www.embedded.com/mastering-stack-and-heap-for-system-reliability-part-1-calculating-stack-size/
- https://www.embedded.com/mastering-stack-and-heap-for-system-reliability-part-2-properly-allocating-stacks/
- https://www.embedded.com/mastering-stack-and-heap-for-system-reliability-part-3-avoiding-heap-errors/
@@ -263,7 +263,7 @@ For example a simple lv_label needs **~140 bytes** of memory.
I tried to monitor this max value while going through all the apps of InfiniTime 1.1 : the max value I've seen is **5660 bytes**. It means that we could probably **reduce the size of the buffer from 14KB to 6 - 10 KB** (we have to take the fragmentation of the memory into account).
### Links
- - https://github.com/JF002/InfiniTime/issues/313#issuecomment-850890064
+ - https://github.com/InfiniTimeOrg/InfiniTime/issues/313#issuecomment-850890064
## FreeRTOS heap and task stack
diff --git a/doc/ble.md b/doc/ble.md
index 518b99c8..2f8ba41c 100644
--- a/doc/ble.md
+++ b/doc/ble.md
@@ -2,23 +2,59 @@
## Introduction
This page describes the BLE implementation and API built in this firmware.
-**Note** : I'm a beginner in BLE related technologies and the information of this document reflect my current knowledge and understanding of the BLE stack. These informations might be erroneous or incomplete. Feel free to submit a PR if you think you can improve these.
+**Note** : I'm a beginner in BLE related technologies and the information in this document reflects my current knowledge and understanding of the BLE stack. This information might be erroneous or incomplete. Feel free to submit a PR if you think you can improve it.
+
+---
+
+### Table of Contents
+
+- [BLE Connection](#ble-connection)
+- [BLE UUIDs](#ble-uuids)
+- [BLE Services](#ble-services)
+ - [CTS](#cts)
+ - [ANS](#ans)
+- [Getting Information](#getting-information)
+ - [Firmware Version](#firmware-version)
+ - [Battery Level](#battery-level)
+ - [Heart Rate](#heart-rate)
+- [Notifications](#notifications)
+ - [New Alert](#new-alert)
+ - [Notification Event](#notification-event)
+- [Firmware Upgrades](#firmware-upgrades)
+ - [Step one](#step-one)
+ - [Step two](#step-two)
+ - [Step three](#step-three)
+ - [Step four](#step-four)
+ - [Step five](#step-five)
+ - [Step six](#step-six)
+ - [Step seven](#step-seven)
+ - [Step eight](#step-eight)
+ - [Step nine](#step-nine)
+- [Music Control](#music-control)
+ - [Events](#events)
+ - [Status](#status)
+ - [Artist, Track, and Album](#artist-track-and-album)
+- [Time](#time)
+
+---
## BLE Connection
-When starting the firmware start a BLE advertising : it sends small messages that can be received by any *central* device in range. This allows the device to announce its presence to other devices.
+When starting, the firmware starts BLE advertising. It sends small messages that can be received by any *central* device in range. This allows the device to announce its presence to other devices.
-A companion application (running on a PC, RaspberryPi, smartphone) which received this avertising packet can request a connection to the device. This connection procedure allows the 2 devices to negotiate communication parameters, security keys,...
+A companion application (running on a PC, Raspberry Pi, smartphone, etc.) which receives this advertising packet can request a connection to the device. This connection procedure allows the 2 devices to negotiate communication parameters, security keys, etc.
-When the connection is established, the pinetime will try to discover services running on the companion application. For now **CTS** (**C**urrent **T**ime **S**ervice) and **ANS** (**A**lert **N**otification **S**ervice) are supported.
+When the connection is established, the PineTime will try to discover services running on the companion application. For now **CTS** (**C**urrent **T**ime **S**ervice) and **ANS** (**A**lert **N**otification **S**ervice) are supported.
If **CTS** is detected, it'll request the current time to the companion application. If **ANS** is detected, it will listen to new notifications coming from the companion application.
![BLE connection sequence diagram](ble/connection_sequence.png "BLE connection sequence diagram")
+---
+
## BLE UUIDs
When possible, InfiniTime tries to implement BLE services defined by the BLE specification.
-When the service does not exist in the BLE specification, InfiniTime implement custom services. As all BLE services, custom services are identified by a UUID. Here is how to define the UUID of custom services in InfiniTime:
+When the service does not exist in the BLE specification, InfiniTime implements custom services. Custom services are identified by a UUID, as are all BLE services. Here is how to define the UUID of custom services in InfiniTime:
```
- Base UUID : xxxxxxxx-78fc-48fe-8e23-433b3a1942d0
@@ -38,6 +74,8 @@ The following custom services are implemented in InfiniTime:
* Navigation Service : 00010000-78fc-48fe-8e23-433b3a1942d0
```
+---
+
## BLE services
[List of standard BLE services](https://www.bluetooth.com/specifications/gatt/services/)
@@ -49,3 +87,197 @@ The following custom services are implemented in InfiniTime:
![ANS sequence diagram](./ble/ans_sequence.png "ANS sequence diagram")
+---
+
+### Getting Information
+
+The InfiniTime firmware exposes some information about itself through BLE. The BLE characteristic UUIDs for this information are as follows:
+
+- Firmware Version: `00002a26-0000-1000-8000-00805f9b34fb`
+- Battery Level: `00002a19-0000-1000-8000-00805f9b34fb`
+- Heart Rate: `00002a37-0000-1000-8000-00805f9b34fb`
+
+#### Firmware Version
+
+Reading a value from the firmware version characteristic will yield a UTF-8 encoded string containing the version of InfiniTime being run on the device. Example: `1.6.0`.
+
+#### Battery Level
+
+Reading from the battery level characteristic yields a single byte of data. This byte can be converted to an unsigned 8-bit integer which will be the battery percentage. This characteristic allows notify for updates as the value changes.
+
+#### Heart Rate
+
+Reading from the heart rate characteristic yields two bytes of data. I am not sure of the function of the first byte. It appears to always be zero. The second byte can be converted to an unsigned 8-bit integer which is the current heart rate. This characteristic also allows notify for updates as the value changes.
+
+---
+
+### Notifications
+
+InfiniTime uses the Alert Notification Service (ANS) for notifications. The relevant UUIDs are as follows:
+
+- New Alert: `00002a46-0000-1000-8000-00805f9b34fb`
+- Notification Event: `00020001-78fc-48fe-8e23-433b3a1942d0`
+
+#### New Alert
+
+The new alert characteristic allows sending new notifications to InfiniTime. It requires the following format:
+
+```
+<category><amount>\x00<\x00-separated data>
+```
+
+For example, here is what a normal notification looks like in Golang (language of `itd`):
+
+```go
+// \x00 is the category for simple alert, and there is one new notifcation, hence \x01.
+"\x00\x01\x00Test Title\x00Test Body"
+```
+
+A call notification looks like so:
+
+```go
+// \x03 is the category for calls, and there is one new call notifcation, hence \x01.
+"\x03\x01\x00Mary"
+```
+
+The `\x00` stands for hexadecimal `00` which means null.
+
+Here is the list of categories and commands:
+
+- Simple Alert: `0`
+- Email: `1`
+- News: `2`
+- Call Notification: `3`
+- Missed Call: `4`
+- SMS/MMS: `5`
+- Voicemail: `6`
+- Schedule: `7`
+- High Prioritized Alert: `8`
+- Instant Message: `9`
+- All Alerts: `0xFF`
+
+These lists and information were retrieved from the following pages in the Nordic docs:
+
+- [Alert Notification Service Client](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.2.0%2Fgroup__ble__ans__c.html)
+- [Alert Notification Application](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Fble_sdk_app_alert_notification.html)
+
+#### Notification Event
+
+A call notification in InfiniTime contains three buttons. Decline, Accept, and Mute. The notification event characteristic contains the button tapped by the user on a call notification. This characteristic only allows notify, **not** read.
+
+Enabling notifications from this characteristic, you get a single byte whenever the user taps a button on the call notification. This byte is an unsigned 8-bit integer that signifies one of the buttons. The numbers are as follows:
+
+- 0: Declined
+- 1: Accepted
+- 2: Muted
+
+---
+
+### Firmware Upgrades
+
+Firmware upgrades in InfiniTime are probably the most complex of the BLE operations. It is a nine step process requiring multiple commands be sent to multiple characteristics. The relevant UUIDs are as follows:
+
+- Control Point: `00001531-1212-efde-1523-785feabcd123`
+- Packet: `00001532-1212-efde-1523-785feabcd123`
+
+A DFU upgrade archive for InfiniTime consists of multiple files. The most important being the .bin and .dat files. The first is the actual firmware, while the second is a packet that initializes DFU. Both are needed for a DFU upgrade.
+
+The first thing to do is to enable notifications on the control point characteristic. This will be needed for verifying that the proper responses are being sent back from InfiniTime.
+
+#### Step one
+
+For the first step, write `0x01`, `0x04` to the control point characteristic. This will signal InfiniTime that a DFU upgrade is to be started.
+
+#### Step two
+
+In step two, send the total size in bytes of the firmware file to the packet characteristic. This value should be an unsigned 32-bit integer encoded as little-endian. In front of this integer should be 8 null bytes. This is because there are three items that can be updated and each 4 bytes is for one of those. The last four are for the InfiniTime application, so those are the ones that need to be set.
+
+#### Step three
+
+Before running step three, wait for a response from the control point. This response should be `0x10`, `0x01`, `0x01` which indicates a successful DFU start. In step three, send `0x02`, `0x00` to the control point. This will signal InfiniTime to expect the init packet on the packet characteristic.
+
+#### Step four
+
+The previous step prepared InfiniTime for this one. In this step, send the contents of the .dat init packet file to the packet characteristic. After this, send `0x02`, `0x01` indicating that the packet has been sent.
+
+#### Step five
+
+Before running this step, wait to receive `0x10`, `0x02`, `0x01` which indicates that the packet has been received. During this step, send the packet receipt interval to the control point. The firmware file will be sent in segments of 20 bytes each. The packet receipt interval indicates how many segments should be received before sending a receipt containing the amount of bytes received so that it can be confirmed to be the same as the amount sent. This is very useful for detecting packet loss. `itd` uses `0x08`, `0x0A` which indicates 10 segments.
+
+#### Step six
+
+In step six, write `0x03` to the control point, indicating that the firmware will be sent next on the packet characteristic.
+
+#### Step seven
+
+This step is the most difficult. Here, the actual firmware is sent to InfiniTime.
+
+As mentioned before, the firmware file must be split up into segments of 20 bytes each and sent to the packet characteristic one by one. Every 10 segments (or whatever you have set the interval to), check for a response starting with `0x11`. The rest of the response will be the amount of bytes received encoded as a little-endian unsigned 32-bit integer. Confirm that this matches the amount of bytes sent, and then continue sending more segments.
+
+#### Step eight
+
+Before running this step, wait to receive `0x10`, `0x03`, `0x01` which indicates a successful receipt of the firmware image. In this step, write `0x04` to the control point to signal InfiniTime to validate the image it has received.
+
+#### Step nine
+
+Before running this step, wait to receive `0x10`, `0x04`, `0x01` which indicates that the image has been validated. In this step, send `0x05` to the control point as a command with no response. This signals InfiniTime to activate the new firmware and reboot.
+
+Once all of these steps are complete, the DFU is complete. Don't forget to validate the firmware in the settings.
+
+---
+
+### Music Control
+
+InfiniTime contains a music controller app which is meant to control the music playback and volume through the companion.
+
+The following UUIDs are relevant to this:
+
+- Events: `00000001-78fc-48fe-8e23-433b3a1942d0`
+- Status: `00000002-78fc-48fe-8e23-433b3a1942d0`
+- Artist: `00000003-78fc-48fe-8e23-433b3a1942d0`
+- Track: `00000004-78fc-48fe-8e23-433b3a1942d0`
+- Album: `00000005-78fc-48fe-8e23-433b3a1942d0`
+
+#### Events
+
+The events characteristic is meant to respond to user input in the music controller app.
+
+Enabling notifications on this characteristic gives you a single byte upon any event. This byte can be converted to an unsigned 8-bit integer which corresponds to each possible event. Here are the events:
+
+- App Opened: `0xe0`
+- Play: `0x00`
+- Pause: `0x01`
+- Next: `0x03`
+- Previous: `0x04`
+- Volume up: `0x05`
+- Volume down: `0x06`
+
+#### Status
+
+The status characteristic allows setting the playing status of music. Send `0x01` to the status characteristic for playing, and `0x00` for paused.
+
+#### Artist, Track, and Album
+
+These characteristics all work the same way. Simply send a UTF-8 encoded string to the relevant characteristic in order to set the value in the app.
+
+---
+
+### Time
+
+InfiniTime allows setting its time via the Current Time Service (CTS)
+
+The UUID for the current time characteristic is: `00002a2b-0000-1000-8000-00805f9b34fb`
+
+This characteristic expects a particular format:
+
+- Year (`uint16`)
+- Month (`uint8`)
+- Day (`uint8`)
+- Hour (`uint8`)
+- Minute (`uint8`)
+- Second (`uint8`)
+- Weekday (`uint8`)
+- Microsecond divided by `1e6*256` (`uint8`)
+- Binary 0001 (`uint8`)
+
+Write all of these together, encoded as little-endian, to the current time characteristic. \ No newline at end of file
diff --git a/doc/buildAndProgram.md b/doc/buildAndProgram.md
index 5b22014e..3e000a3a 100644
--- a/doc/buildAndProgram.md
+++ b/doc/buildAndProgram.md
@@ -16,7 +16,7 @@ To build this project, you'll need:
## Build steps
### Clone the repo
```
-git clone https://github.com/JF002/InfiniTime.git
+git clone https://github.com/InfiniTimeOrg/InfiniTime.git
cd InfiniTime
git submodule update --init
mkdir build
@@ -38,9 +38,9 @@ CMake configures the project according to variables you specify the command line
**WATCH_COLMI_P8**|Use pin configuration for Colmi P8 watch|`-DWATCH_COLMI_P8=1`
####(**) Note about **CMAKE_BUILD_TYPE**:
-By default, this variable is set to *Release*. It compiles the code with size and speed optimizations. We use this value for all the binaries we publish when we [release](https://github.com/JF002/InfiniTime/releases) new versions of InfiniTime.
+By default, this variable is set to *Release*. It compiles the code with size and speed optimizations. We use this value for all the binaries we publish when we [release](https://github.com/InfiniTimeOrg/InfiniTime/releases) new versions of InfiniTime.
-The *Debug* mode disables all optimizations, which makes the code easier to debug. However, the binary size will likely be too big to fit in the internal flash memory. If you want to build and debug a *Debug* binary, you'll need to disable some parts of the code. For example, the icons for the **Navigation** app use a lot of memory space. You can comment the content of `m_iconMap` in the [Navigation](https://github.com/JF002/InfiniTime/blob/develop/src/displayapp/screens/Navigation.h#L148) application to free some memory.
+The *Debug* mode disables all optimizations, which makes the code easier to debug. However, the binary size will likely be too big to fit in the internal flash memory. If you want to build and debug a *Debug* binary, you'll need to disable some parts of the code. For example, the icons for the **Navigation** app use a lot of memory space. You can comment the content of `m_iconMap` in the [Navigation](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/displayapp/screens/Navigation.h#L148) application to free some memory.
####(**) Note about **BUILD_DFU**:
DFU files are the files you'll need to install your build of InfiniTime using OTA (over-the-air) mecanism. To generate the DFU file, the Python tool [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil) is needed on your system. Check that this tool is properly installed before enabling this option.
diff --git a/doc/buildWithDocker.md b/doc/buildWithDocker.md
index 2e4ecbb6..a57893c9 100644
--- a/doc/buildWithDocker.md
+++ b/doc/buildWithDocker.md
@@ -11,7 +11,9 @@ Based on Ubuntu 18.04 with the following build dependencies:
## Run a container to build the project
-The `infinitime-build` image contains all the dependencies you need. The default `CMD` will compile sources found in `/sources`, so you need only mount your code.
+The `infinitime-build` image contains all the dependencies you need. The default `CMD` will compile sources found in `/sources`, so you need only mount your code.
+
+Before continuing, make sure you first build the image as indicated in the [Build the image](#build-the-image) section, or check the [Using the image from Docker Hub](#using-the-image-from-docker-hub) section if you prefer to use a pre-made image.
This example will build the firmware, generate the MCUBoot image and generate the DFU file. For cloning the repo, see [these instructions](../doc/buildAndProgram.md#clone-the-repo). Outputs will be written to **<project_root>/build/output**:
@@ -28,10 +30,10 @@ docker run --rm -it -v $(pwd):/sources infinitime-build /opt/build.sh pinetime-a
The image is built using 1000:1000 for the user id and group id. If this is different to your user or group ids (run `id -u` and `id -g` to find out what your id values are if you are unsure), you will need to override them via the `--user` parameter in order to prevent permission errors with the output files (and the cmake build cache).
-Running with this image is the same as above, you just specify the ids to `docker run`
+Running with this image is the same as above, you just specify the ids to `docker run`:
```bash
-docker run --rm -it -v $(pwd):/sources --user $(id -u):$(id -g) pfeerick/infinitime-build
+docker run --rm -it -v $(pwd):/sources --user $(id -u):$(id -g) infinitime-build
```
Or you can specify your user id and group id (by number, not by name) directly:
@@ -42,7 +44,7 @@ docker run --rm -it -v $(pwd):/sources --user 1234:1234 infinitime-build
## Using the image from Docker Hub
-The image is avaiable via Docker Hub for both the amd64 and arm64v8 architectures at [pfeerick/infinitime-build](https://hub.docker.com/repository/docker/pfeerick/infinitime-build).
+The image is available via Docker Hub for both the amd64 and arm64v8 architectures at [pfeerick/infinitime-build](https://hub.docker.com/r/pfeerick/infinitime-build).
It can be pulled (downloaded) using the following command:
diff --git a/doc/code/Apps.md b/doc/code/Apps.md
new file mode 100644
index 00000000..7c2d7a05
--- /dev/null
+++ b/doc/code/Apps.md
@@ -0,0 +1,106 @@
+# Apps
+This page will teach you:
+- what apps in InfiniTime are
+- how to implement your own app
+
+## Theory
+Apps are the things you can launch from the app selection you get by swiping up.
+At the moment, settings and even the app launcher itself or the clock are implemented very similarly, this might change in the future though.
+Every app in InfiniTime is it's own class.
+An instance of the class is created when the app is launched and destroyed when the user exits the app.
+They run inside the "displayapp" task (briefly discussed [here](./Intro.md)).
+Apps are responsible for everything drawn on the screen when they are running.
+By default, apps only do something (as in a function is executed) when they are created or when a touch event is detected.
+
+## Interface
+Every app class has to be inside the namespace `Pinetime::Applications::Screens` and inherit from `Screen`.
+The constructor should have at least one parameter `DisplayApp* app`, which it needs for the constructor of its parent class Screen.
+Other parameters should be references to controllers that the app needs.
+A destructor is needed to clean up LVGL and restore any changes (for example re-enable sleeping).
+App classes can override `bool OnButtonPushed()`, `bool OnTouchEvent(TouchEvents event)` and `bool OnTouchEvent(uint16_t x, uint16_t y)` to implement their own functionality for those events.
+If an app only needs to display some text and do something upon a touch screen button press,
+it does not need to override any of these functions, as LVGL can also handle touch events for you.
+If you have any doubts, you can always look at how the other apps are doing things.
+
+### Continuous updating
+If your app needs to be updated continuously, yo can do so by overriding the `Refresh()` function in your class
+and calling `lv_task_create` inside the constructor.
+An example call could look like this: <br>
+`taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);` <br>
+With `taskRefresh` being a member variable of your class and of type `lv_task_t*`.
+Remember to delete the task again using `lv_task_del`.
+The function `RefreshTaskCallback` is inherited from screen and just calls your `Refresh` function.
+
+### Apps with multiple screens
+InfiniTime provides a mini-library in [displayapp/screens/ScreenList.h](/src/displayapp/screens/ScreenList.h)
+which makes it relatively easy to add multiple screens to your app.
+To use it, #include it in the header file of your app and add a ScreenList member to your class.
+The template argument should be the number of screens you need.
+You will also need to add `CreateScreen` functions that return `std::unique_ptr<Screen>`
+to your class, one for every screen you have.
+There are still some things left to to that I won't cover here.
+To figure them out, have a look at the "apps" ApplicationList, Settings and SystemInfo.
+
+
+## Creating your own app
+A minimal app could look like this: <br>
+MyApp.h:
+```cpp
+#pragma once
+
+#include "displayapp/screens/Screen.h"
+#include <lvgl/lvgl.h>
+
+namespace Pinetime {
+ namespace Applications {
+ namespace Screens {
+ class MyApp : public Screen {
+ public:
+ MyApp(DisplayApp* app);
+ ~MyApp() override;
+ };
+ }
+ }
+}
+```
+
+MyApp.cpp:
+```cpp
+#include "MyApp.h"
+#include "displayapp/DisplayApp.h"
+
+using namespace Pinetime::Applications::Screens;
+
+MyApp::MyApp(DisplayApp* app) : Screen(app) {
+ lv_obj_t* title = lv_label_create(lv_scr_act(), NULL);
+ lv_label_set_text_static(title, "My test application");
+ lv_label_set_align(title, LV_LABEL_ALIGN_CENTER);
+ lv_obj_align(title, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
+}
+
+MyApp::~MyApp() {
+ lv_obj_clean(lv_scr_act());
+}
+```
+Both of these files should be in [displayapp/screens/](/src/displayapp/screens/)
+or [displayapp/screens/settings/](/src/displayapp/screens/settings/) if it's a setting app.
+
+Now we have our very own app, but InfiniTime does not know about it yet.
+The first step is to include your MyApp.cpp (or any new cpp files for that matter)
+in the compilation by adding it to [CMakeLists.txt](/CMakeLists.txt).
+The next step to making it launchable is to give your app an id.
+To do this, add an entry in the enum class `Pinetime::Applications::Apps` ([displayapp/Apps.h](/src/displayapp/Apps.h)).
+Name this entry after your app. Add `#include "displayapp/screens/MyApp.h"` to the file [displayapp/DisplayApp.cpp](/src/displayapp/DisplayApp.cpp).
+Now, go to the function `DisplayApp::LoadApp` and add another case to the switch statement.
+The case will be the id you gave your app earlier.
+If your app needs any additional arguments, this is the place to pass them.
+
+If you want your app to be launched from the regular app launcher, go to [displayapp/screens/ApplicationList.cpp](/src/displayapp/screens/ApplicationList.cpp).
+Add your app to one of the `CreateScreen` functions, or add another `CreateScreen` function if there are no empty spaces for your app. <br>
+If your app is a setting, do the same procedure in [displayapp/screens/settings/Settings.cpp](/src/displayapp/screens/settings/Settings.cpp).
+
+You should now be able to [build](../buildAndProgram.md) the firmware
+and flash it to your PineTime. Yay!
+
+Please remember to pay attention to the [UI guidelines](../ui_guidelines.md)
+when designing an app that you want to include in mainstream InfiniTime.
diff --git a/doc/code/Intro.md b/doc/code/Intro.md
new file mode 100644
index 00000000..762102fe
--- /dev/null
+++ b/doc/code/Intro.md
@@ -0,0 +1,42 @@
+# Introduction to the code
+This page is meant to guide you through the source code, so you can find the relevant files for what you're working on.
+
+## FreeRTOS
+Infinitime is based on FreeRTOS, a real-time operating system.
+FreeRTOS provides several quality of life abstractions (for example easy software timers)
+and most importantly supports multiple tasks.
+If you want to read up on real-time operating systems, you can look [here](https://www.freertos.org/implementation/a00002.html) and [here](https://www.freertos.org/features.html).
+The main "process" creates at least one task and then starts the FreeRTOS task scheduler.
+This main "process" is the standard main() function inside [main.cpp](/src/main.cpp).
+The task scheduler is responsible for giving every task enough cpu time.
+As there is only one core on the SoC of the PineTime, real concurrency is impossible and the scheduler has to swap tasks in and out to emulate it.
+
+### Tasks
+Tasks are created by calling `xTaskCreate` and passing a function with the signature `void functionName(void*)`.
+For more info on task creation see the [FreeRTOS Documentation](https://www.freertos.org/a00125.html).
+In our case, main calls `systemTask.Start()`, which creates the **"MAIN" task**.
+The function running inside that task is `SystemTask::Work()`.
+You may also see this task being referred to as the **work task**.
+Both functions are located inside [systemtask/SystemTask.cpp](/src/systemtask/SystemTask.cpp). `SystemTask::Work()` initializes all the driver and controller objects.
+It also starts the **task "displayapp"**, which is responsible for launching and running apps, controlling the screen and handling touch events (or forwarding them to the active app).
+You can find the "displayapp" task inside [displayapp/DisplayApp.cpp](/src/displayapp/DisplayApp.cpp).
+There are also other tasks that are responsible for Bluetooth ("ll" and "ble" inside [libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c](/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c))
+and periodic tasks like heartrate measurements ([heartratetask/HeartRateTask.cpp](/src/heartratetask/HeartRateTask.cpp)). <br>
+While it is possible for you to create your own task when you need it, it is recommended to just add functionality to `SystemTask::Work()` if possible.
+If you absolutely need to create another task, try to guess how much [stack space](https://www.freertos.org/FAQMem.html#StackSize) (in words/4-byte packets)
+it will need instead of just typing in a large-ish number.
+You can use the define `configMINIMAL_STACK_SIZE` which is currently set to 120 words.
+
+## Controllers
+Controllers in InfiniTime are singleton objects that can provide access to certain resources to apps.
+Some of them interface with drivers, others are the driver for the resource.
+The resources provided don't have to be hardware-based.
+They are declared in main.cpp and initialized in [systemtask/SystemTask.cpp](/src/systemtask/SystemTask.cpp).
+Some controllers can be passed by reference to apps that need access to the resource (for example vibration motor).
+They reside in [components/](/src/components/) inside their own subfolder.
+
+## Apps
+For more detail see the [Apps page](./Apps.md)
+
+## Bluetooth
+Header files with short documentation for the functions are inside [libs/mynewt-nimble/nimble/host/include/host/](/src/libs/mynewt-nimble/nimble/host/include/host/).
diff --git a/doc/contribute.md b/doc/contribute.md
index b84d6c9c..21746433 100644
--- a/doc/contribute.md
+++ b/doc/contribute.md
@@ -2,7 +2,7 @@
## Report bugs
-Have you found 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...
+Have you found a bug in the firmware? [Create an issue on Github](https://github.com/InfiniTimeOrg/InfiniTime/issues) explaining the bug, how to reproduce it, the version of the firmware you use...
## Write and improve documentation
diff --git a/doc/filesInReleaseNotes.md b/doc/filesInReleaseNotes.md
index 1a37fefb..6a5873c0 100644
--- a/doc/filesInReleaseNotes.md
+++ b/doc/filesInReleaseNotes.md
@@ -1,9 +1,9 @@
# Using the releases
-For each new *stable* version of IniniTime, a [release note](https://github.com/JF002/InfiniTime/releases) is created. It contains a description of the main changes in the release and some files you can use to flash the firmware to your Pinetime.
+For each new *stable* version of IniniTime, a [release note](https://github.com/InfiniTimeOrg/InfiniTime/releases) is created. It contains a description of the main changes in the release and some files you can use to flash the firmware to your Pinetime.
This page describes the files from the release notes and how to use them.
-**NOTE :** the files included in different Releases could be different. This page describes the release notes of [version 0.7.1](https://github.com/JF002/InfiniTime/releases/tag/0.7.1), which is the version that is pre-programmed for the last batches of pinetimes but will be replaced with [1.0.0](https://github.com/jF002/infiniTime/releases/tag/1.0.0) around june 2021.
+**NOTE :** the files included in different Releases could be different. This page describes the release notes of [version 0.7.1](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.7.1), which is the version that is pre-programmed for the last batches of pinetimes but will be replaced with [1.0.0](https://github.com/jF002/infiniTime/releases/tag/1.0.0) around june 2021.
## Files included in the release notes
diff --git a/doc/gettingStarted/gettingStarted-1.0.md b/doc/gettingStarted/gettingStarted-1.0.md
index 88ff2072..3f8f38f6 100644
--- a/doc/gettingStarted/gettingStarted-1.0.md
+++ b/doc/gettingStarted/gettingStarted-1.0.md
@@ -8,15 +8,15 @@ You might have already seen these words by reading the announcement, release not
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,...
+ - **[InfiniTime](https://github.com/InfiniTimeOrg/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).
+ - **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/InfiniTimeOrg/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.
+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/InfiniTimeOrg/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 successful OTA or a manual reset - long push on the button).
@@ -33,7 +33,7 @@ And for version >= 1.0 :
![InfiniTime 1.0 version](version-1.0.jpg)
-PineTime shipped from June 2021 (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).
+PineTime shipped from June 2021 (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/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1) and [InfiniTime 1.0](https://github.com/InfiniTimeOrg/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).
@@ -56,9 +56,9 @@ If your PineTime is currently running InfiniTime 0.7.1 and the old bootloader, w
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).
+ 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/InfiniTimeOrg/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).
+ 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/InfiniTimeOrg/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)
diff --git a/doc/gettingStarted/ota-gadgetbridge-nrfconnect.md b/doc/gettingStarted/ota-gadgetbridge-nrfconnect.md
index ffc27ed8..57d16218 100644
--- a/doc/gettingStarted/ota-gadgetbridge-nrfconnect.md
+++ b/doc/gettingStarted/ota-gadgetbridge-nrfconnect.md
@@ -8,7 +8,7 @@ If you just want to flash or upgrade InfiniTime on your PineTime, this page is f
- [How to flash InfiniTime using the SWD interface](#how-to-flash-infinitime-using-the-swd-interface)
## InfiniTime releases and versions
-All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/JF002/InfiniTime/releases).
+All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases).
Versions that are tagged as **RELEASE CANDIDATE** are pre-release versions, that are available for testing before actually releasing a new stable version. If you want to help us debug the project and provide stable versions to other user, you can use them. If you want stable and tested version, you should not flash these release candidate version.
diff --git a/docker/build.sh b/docker/build.sh
index 2fa7d920..d86e7c21 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -43,7 +43,7 @@ GetGcc() {
}
GetMcuBoot() {
- git clone https://github.com/JuulLabs-OSS/mcuboot.git "$TOOLS_DIR/mcuboot"
+ git clone https://github.com/mcu-tools/mcuboot.git "$TOOLS_DIR/mcuboot"
pip3 install -r "$TOOLS_DIR/mcuboot/scripts/requirements.txt"
}
diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h
index 425e0aca..9f5fb130 100644
--- a/src/displayapp/DisplayAppRecovery.h
+++ b/src/displayapp/DisplayAppRecovery.h
@@ -10,6 +10,7 @@
#include <date/date.h>
#include <drivers/Watchdog.h>
#include <components/motor/MotorController.h>
+#include <BootErrors.h>
#include "TouchEvents.h"
#include "Apps.h"
#include "Messages.h"
@@ -58,6 +59,7 @@ namespace Pinetime {
Pinetime::Controllers::AlarmController& alarmController,
Pinetime::Controllers::TouchHandler& touchHandler);
void Start();
+ void Start(Pinetime::System::BootErrors){ Start(); };
void PushMessage(Pinetime::Applications::Display::Messages msg);
void Register(Pinetime::System::SystemTask* systemTask);
diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp
index 3b6d60e3..26c2368b 100644
--- a/src/displayapp/screens/Paddle.cpp
+++ b/src/displayapp/screens/Paddle.cpp
@@ -47,8 +47,8 @@ void Paddle::Refresh() {
dy *= -1;
}
- // checks if it has touched the side (left side)
- if (ballX >= LV_VER_RES - ballSize - 1) {
+ // checks if it has touched the side (right side)
+ if (ballX >= LV_HOR_RES - ballSize - 1) {
dx *= -1;
}
diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp
index 6766ecb0..fa88d459 100644
--- a/src/displayapp/screens/PineTimeStyle.cpp
+++ b/src/displayapp/screens/PineTimeStyle.cpp
@@ -1,5 +1,5 @@
/*
- * This file is part of the Infinitime distribution (https://github.com/JF002/Infinitime).
+ * This file is part of the Infinitime distribution (https://github.com/InfiniTimeOrg/Infinitime).
* Copyright (c) 2021 Kieran Cawthray.
*
* This program is free software: you can redistribute it and/or modify
diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp
index 475fbb88..343b72bf 100644
--- a/src/displayapp/screens/SystemInfo.cpp
+++ b/src/displayapp/screens/SystemInfo.cpp
@@ -206,11 +206,14 @@ bool SystemInfo::sortById(const TaskStatus_t& lhs, const TaskStatus_t& rhs) {
}
std::unique_ptr<Screen> SystemInfo::CreateScreen4() {
- TaskStatus_t tasksStatus[10];
+ static constexpr uint8_t maxTaskCount = 9;
+ TaskStatus_t tasksStatus[maxTaskCount];
+
lv_obj_t* infoTask = lv_table_create(lv_scr_act(), NULL);
lv_table_set_col_cnt(infoTask, 4);
- lv_table_set_row_cnt(infoTask, 8);
- lv_obj_set_pos(infoTask, 0, 10);
+ lv_table_set_row_cnt(infoTask, maxTaskCount + 1);
+ lv_obj_set_style_local_pad_all(infoTask, LV_TABLE_PART_CELL1, LV_STATE_DEFAULT, 0);
+ lv_obj_set_style_local_border_color(infoTask, LV_TABLE_PART_CELL1, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_table_set_cell_value(infoTask, 0, 0, "#");
lv_table_set_col_width(infoTask, 0, 30);
@@ -221,9 +224,9 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen4() {
lv_table_set_cell_value(infoTask, 0, 3, "Free");
lv_table_set_col_width(infoTask, 3, 90);
- auto nb = uxTaskGetSystemState(tasksStatus, sizeof(tasksStatus) / sizeof(tasksStatus[0]), nullptr);
+ auto nb = uxTaskGetSystemState(tasksStatus, maxTaskCount, nullptr);
std::sort(tasksStatus, tasksStatus + nb, sortById);
- for (uint8_t i = 0; i < nb && i < 7; i++) {
+ for (uint8_t i = 0; i < nb && i < maxTaskCount; i++) {
lv_table_set_cell_value(infoTask, i + 1, 0, std::to_string(tasksStatus[i].xTaskNumber).c_str());
char state[2] = {0};
@@ -267,7 +270,8 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen5() {
"Public License v3\n"
"#444444 Source code#\n"
"#FFFF00 https://github.com/#\n"
- "#FFFF00 JF002/InfiniTime#");
+ "#FFFF00 InfiniTimeOrg/#\n"
+ "#FFFF00 InfiniTime#");
lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
lv_obj_align(label, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
return std::make_unique<Screens::Label>(4, 5, app, label);
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp
index f79fd8e5..f1c5165a 100644
--- a/src/systemtask/SystemTask.cpp
+++ b/src/systemtask/SystemTask.cpp
@@ -250,12 +250,13 @@ void SystemTask::Work() {
isDimmed = false;
break;
case Messages::TouchWakeUp: {
- if(touchHandler.GetNewTouchInfo()) {
+ if (touchHandler.GetNewTouchInfo()) {
auto gesture = touchHandler.GestureGet();
- if (gesture != Pinetime::Drivers::Cst816S::Gestures::None and ((gesture == Pinetime::Drivers::Cst816S::Gestures::DoubleTap and
- settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::DoubleTap)) or
- (gesture == Pinetime::Drivers::Cst816S::Gestures::SingleTap and
- settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::SingleTap)))) {
+ if (gesture != Pinetime::Drivers::Cst816S::Gestures::None and
+ ((gesture == Pinetime::Drivers::Cst816S::Gestures::DoubleTap and
+ settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::DoubleTap)) or
+ (gesture == Pinetime::Drivers::Cst816S::Gestures::SingleTap and
+ settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::SingleTap)))) {
GoToRunning();
}
}
@@ -276,6 +277,8 @@ void SystemTask::Work() {
if (settingsController.GetNotificationStatus() == Pinetime::Controllers::Settings::Notification::ON) {
if (isSleeping && !isWakingUp) {
GoToRunning();
+ } else {
+ ReloadIdleTimer();
}
displayApp.PushMessage(Pinetime::Applications::Display::Messages::NewNotification);
}