Skip to content

Commit 7cbc2a8

Browse files
Merge main into unifyDockerDevcontainer
1 parent 379c4e7 commit 7cbc2a8

File tree

163 files changed

+1196
-1298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+1196
-1298
lines changed

.github/ISSUE_TEMPLATE/bug-report.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ body:
4141
attributes:
4242
label: Version
4343
description: |
44-
What [version of the firmware](https://github.com/JF002/InfiniTime/blob/develop/doc/gettingStarted/gettingStarted-1.0.md#how-to-check-the-version-of-infinitime-and-the-bootloader) are you running?
45-
If you are running an older version, please consider [updating to the latest firmware](https://github.com/JF002/InfiniTime/blob/develop/doc/gettingStarted/gettingStarted-1.0.md#how-to-update-your-pinetime).
44+
What [version of the firmware](https://github.com/InfiniTimeOrg/InfiniTime/blob/main/doc/gettingStarted/updating-software.md#checking-the-version-of-infinitime) are you running?
45+
If you are running an older version, please consider [updating to the latest firmware](https://github.com/InfiniTimeOrg/InfiniTime/blob/main/doc/gettingStarted/updating-software.md#updating-with-companion-apps).
4646
If you are running directly from git, specify the branch or the commit hash directly.
47-
placeholder: "Ex. v1.6.0 or develop or fc922b60"
47+
placeholder: "Ex. v1.11.0 or main or fc922b60"
4848
validations:
4949
required: true
5050
- type: input

.github/ISSUE_TEMPLATE/issue-report.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ body:
2323
attributes:
2424
label: Version
2525
description: |
26-
What [version of the firmware](https://github.com/JF002/InfiniTime/blob/develop/doc/gettingStarted/gettingStarted-1.0.md#how-to-check-the-version-of-infinitime-and-the-bootloader) are you running?
27-
If you are running an older version, please consider [updating to the latest firmware](https://github.com/JF002/InfiniTime/blob/develop/doc/gettingStarted/gettingStarted-1.0.md#how-to-update-your-pinetime).
26+
What [version of the firmware](https://github.com/InfiniTimeOrg/InfiniTime/blob/main/doc/gettingStarted/updating-software.md#checking-the-version-of-infinitime) are you running?
27+
If you are running an older version, please consider [updating to the latest firmware](https://github.com/InfiniTimeOrg/InfiniTime/blob/main/doc/gettingStarted/updating-software.md#updating-with-companion-apps).
2828
If you are running directly from git, specify the branch or the commit hash directly.
29-
placeholder: Ex. v1.6.0 or develop or fc922b60
29+
placeholder: Ex. v1.11.0 or main or fc922b60
3030
validations:
3131
required: false

.github/workflows/docker.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Build and push Docker image
22

33
on:
44
push:
5-
branches: [ develop ]
5+
branches: [ main ]
66
paths:
77
- 'docker/**'
88
pull_request:
9-
branches: [ develop ]
9+
branches: [ main ]
1010
paths:
1111
- 'docker/**'
1212
# Allows you to run this workflow manually from the Actions tab

.github/workflows/format.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Code formatting
22

33
on:
44
pull_request:
5-
branches: [ develop ]
5+
branches: [ main ]
66
paths:
77
- '**.cpp'
88
- '**.h'

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name: CI
33
# Run this workflow whenever the build may be affected
44
on:
55
push:
6-
branches: [ master, develop ]
6+
branches: [ main ]
77
paths-ignore:
88
- 'doc/**'
99
- '**.md'
1010
pull_request:
11-
branches: [ develop ]
11+
branches: [ main ]
1212
paths-ignore:
1313
- 'doc/**'
1414
- '**.md'

.github/workflows/pr-comment.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: PR comment
55

66
on:
77
pull_request_target:
8-
branches: [ develop ]
8+
branches: [ main ]
99
paths-ignore:
1010
- 'doc/**'
1111
- '**.md'
@@ -23,9 +23,16 @@ jobs:
2323
ref: ${{ github.event.pull_request.head.sha }}
2424

2525
- if: steps.wait-for-build.outputs.conclusion != 'success'
26-
run: exit 1
26+
run: |
27+
tee comment << EOF
28+
Build checks have not completed. Possible reasons for this are:
29+
1. The checks need to be approved by a maintainer
30+
2. The branch has conflicts
31+
3. The firmware build has failed
32+
EOF
2733
28-
- name: Download artifact
34+
- if: steps.wait-for-build.outputs.conclusion == 'success'
35+
name: Download artifact
2936
uses: dawidd6/action-download-artifact@bd10f381a96414ce2b13a11bfa89902ba7cea07f
3037
with:
3138
workflow: main.yml
@@ -39,7 +46,6 @@ jobs:
3946
with:
4047
issue-number: ${{ github.event.pull_request.number }}
4148
comment-author: 'github-actions[bot]'
42-
body-includes: Build size and comparison to
4349

4450
- name: Create or update comment
4551
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808

.gitmodules

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
[submodule "src/libs/lvgl"]
22
path = src/libs/lvgl
3-
url = https://github.com/joaquimorg/lvgl.git
3+
url = https://github.com/InfiniTimeOrg/lvgl.git
44
[submodule "src/libs/littlefs"]
55
path = src/libs/littlefs
66
url = https://github.com/littlefs-project/littlefs.git
77
[submodule "src/libs/QCBOR"]
88
path = src/libs/QCBOR
99
url = https://github.com/laurencelundblade/QCBOR.git
10-
[submodule "src/libs/date"]
11-
path = src/libs/date
12-
url = https://github.com/HowardHinnant/date.git

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
22

33
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose Debug or Release")
44

5-
project(pinetime VERSION 1.11.0 LANGUAGES C CXX ASM)
5+
project(pinetime VERSION 1.12.0 LANGUAGES C CXX ASM)
66

77
set(CMAKE_C_STANDARD 99)
88
set(CMAKE_CXX_STANDARD 14)

CONTRIBUTING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Here are things you can do to help.
66
- [Write and improve documentation](#documentation)
77
- [Fix bugs, add functionalities and improve the code](#how-to-create-a-pull-request)
88
- Participate in the discussions within issues and PRs. Your feedback is appreciated!
9-
- Review pull requests. Follow the instructions [here](maintainer-guide.md#reviewing-prs)
9+
- Review pull requests. Follow the instructions [here](doc/maintainer-guide.md#reviewing-prs)
1010

1111
## Documentation
1212

@@ -22,7 +22,7 @@ The workflow is based on [GitHub flow](https://docs.github.com/en/get-started/qu
2222

2323
To create a pull request,
2424
you need a [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) of the repo.
25-
Create a new [branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches) from develop,
25+
Create a new [branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches) from main,
2626
make changes in this branch,
2727
[commit](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/about-commits) them,
2828
and create a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).
@@ -31,11 +31,11 @@ and create a [pull request](https://docs.github.com/en/pull-requests/collaborati
3131

3232
When making changes to the firmware:
3333

34-
- Consider if your feature aligns with the [InfiniTime vision](InfiniTimeVision.md)
34+
- Consider if your feature aligns with the [InfiniTime vision](doc/InfiniTimeVision.md)
3535
- Test your changes on a PineTime or InfiniSim
36-
- Make sure the code conforms to the [coding conventions](coding-convention.md)
36+
- Make sure the code conforms to the [coding conventions](doc/coding-convention.md)
3737

38-
You can also check the [maintainer's guide](maintainer-guide.md)
38+
You can also check the [maintainer's guide](doc/maintainer-guide.md)
3939
for what maintainers will look at in PRs.
4040

4141
### Commit conventions

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)
22

3-
[![Build PineTime Firmware](https://github.com/InfiniTimeOrg/InfiniTime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master)](https://github.com/InfiniTimeOrg/InfiniTime/actions)
4-
53
![InfiniTime logo](doc/logo/infinitime-logo-small.jpg "InfiniTime Logo")
64

75
Fast open-source firmware for the [PineTime smartwatch](https://www.pine64.org/pinetime/) with many features, written in modern C++.

doc/ExternalResources.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This page describes how the resources are integrated in InfiniTime from a develo
66

77
## Resources generation
88

9-
Resources are generated at build time via the [CMake target `Generate Resources`](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/resources/CMakeLists.txt#L19).
9+
Resources are generated at build time via the [CMake target `Generate Resources`](https://github.com/InfiniTimeOrg/InfiniTime/blob/main/src/resources/CMakeLists.txt#L19).
1010
It runs 3 Python scripts that respectively convert the fonts to binary format, convert the images to binary format and package everything in a .zip file.
1111

1212
The resulting file `infinitime-resources-x.y.z.zip` contains the images and fonts converted in binary `.bin` files and a JSON file `resources.json`.

doc/MemoryAnalysis.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ In Infinitime 1.1, the biggest buffers are the buffers allocated for LVGL (14KB)
104104

105105
### Stack
106106

107-
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).
107+
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/main/nrf_common.ld#L148).
108108
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.
109109

110110
#### Fill the stack section by a known pattern:
@@ -216,7 +216,7 @@ According to my experimentations, we don't use the stack that much, and 8192 byt
216216

217217
### Heap
218218

219-
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`...).
219+
The heap is declared in the [linker script](https://github.com/InfiniTimeOrg/InfiniTime/blob/main/nrf_common.ld#L136) and its current size is 8192 bytes. The heap is used for dynamic memory allocation(`malloc()`, `new`...).
220220

221221
Heap monitoring is not easy, but it seems that we can use the following code to know the current usage of the heap:
222222

doc/branches.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Branches
22

3-
The branching model of this project is based on the workflow named [Git flow](https://nvie.com/posts/a-successful-git-branching-model/).
3+
The project has 1 main branch, aptly called **main**.
4+
This branch contains the latest development that will be tagged for the next release once it's considered stable.
45

5-
The project is based on 2 main branches:
6+
New features should be implemented in **feature branches** created from **main**.
7+
When the feature is ready, a pull request is created and it'll be merged into **main** when it is successfully reviewed and accepted.
68

7-
- **master** : this branch is always ready to be deployed. It means that at any time, we should be able to build the branch and release a new version of the application.
8-
- **develop** : this branch contains the latest development that will be integrated in the next release once it's considered as stable.
9+
To release a new version of the application, when main is considered stable, a tag is created on the version bump commit in **main** and the release is generated (a tag is applied to git, the release note is finalized, binaries are built,...).
910

10-
New features should be implemented in **feature branches** created from **develop**. When the feature is ready, a pull-request is created and it'll be merge into **develop** when it is successfully reviewed and accepted.
11-
12-
To release a new version of the application, when develop is considered stable, a **release** branch is created from **develop**. This can be considered as a *release candidate* branch. When everything is OK, this release branch is merged into **master** and the release is generated (a tag is applied to git, the release note is finalized, binaries are built,...) from **master**.
13-
14-
Git flow also supports the creation of **hotfix** branches when a bug is discovered in a released version. The **hotfix** branch is created from **master** and will be used only to implement a fix to this bug. Multiple hotfix branches can be created for the same release if multiple bugs are discovered.
11+
We also supports the creation of **hotfix** branches when a bug is discovered in a released version. The **hotfix** branch is created from the latest tag and will be used only to implement a fix to this bug.
12+
Multiple hotfix branches can be created for the same release if multiple bugs are discovered.

doc/buildAndProgram.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ CMake configures the project according to variables you specify the command line
4848
#### (\*) Note about **CMAKE_BUILD_TYPE**
4949
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.
5050
51-
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.
51+
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/main/src/displayapp/screens/Navigation.h#L148) application to free some memory.
5252

5353
#### (\*\*) Note about **BUILD_DFU**
5454
DFU files are the files you'll need to install your build of InfiniTime using OTA (over-the-air) mechanism. 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.

doc/buildWithVScode.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The .devcontainer folder contains the configuration and scripts for using a Dock
3232

3333
Using the [Remote-Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension is recommended. It will handle configuring the Docker virtual machine and setting everything up.
3434

35-
More documentation is available in the [readme for devcontainers](usingDevcontainers.md)
35+
More documentation is available in the [readme in .devcontainer](../.devcontainer/README.md)
3636

3737
### DevContainer on Ubuntu
3838

doc/versioning.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
The versioning of this project is based on [Semantic versioning](https://semver.org/):
44

55
- The **patch** is incremented when a bug is fixed on a **released** version (most of the time using a **hotfix** branch).
6-
- The **minor** is incremented when a new version with new features is released. It corresponds to a merge of **develop** into **master**.
6+
- The **minor** is incremented when a new version with new features is released. It corresponds to a tag of a commit in **main**.
77
- The **major** should be incremented when a breaking change is made to the application. We still have to define what is a breaking change in the context of this project.

src/CMakeLists.txt

+4-13
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ list(APPEND SOURCE_FILES
472472
components/firmwarevalidator/FirmwareValidator.cpp
473473
components/motor/MotorController.cpp
474474
components/settings/Settings.cpp
475-
components/timer/TimerController.cpp
475+
components/timer/Timer.cpp
476476
components/alarm/AlarmController.cpp
477477
components/fs/FS.cpp
478478
drivers/Cst816s.cpp
@@ -537,7 +537,7 @@ list(APPEND RECOVERY_SOURCE_FILES
537537
components/ble/MotionService.cpp
538538
components/firmwarevalidator/FirmwareValidator.cpp
539539
components/settings/Settings.cpp
540-
components/timer/TimerController.cpp
540+
components/timer/Timer.cpp
541541
components/alarm/AlarmController.cpp
542542
drivers/Cst816s.cpp
543543
FreeRTOS/port.c
@@ -653,19 +653,11 @@ set(INCLUDE_FILES
653653
components/ble/MotionService.h
654654
components/ble/weather/WeatherService.h
655655
components/settings/Settings.h
656-
components/timer/TimerController.h
656+
components/timer/Timer.h
657657
components/alarm/AlarmController.h
658658
drivers/Cst816s.h
659659
FreeRTOS/portmacro.h
660660
FreeRTOS/portmacro_cmsis.h
661-
libs/date/include/date/tz.h
662-
libs/date/include/date/chrono_io.h
663-
libs/date/include/date/date.h
664-
libs/date/include/date/islamic.h
665-
libs/date/include/date/iso_week.h
666-
libs/date/include/date/julian.h
667-
libs/date/include/date/ptz.h
668-
libs/date/include/date/tz_private.h
669661
displayapp/LittleVgl.h
670662
displayapp/InfiniTimeTheme.h
671663
systemtask/SystemTask.h
@@ -690,7 +682,6 @@ include_directories(
690682
include_directories(SYSTEM
691683
libs/
692684
FreeRTOS/
693-
libs/date/include
694685
libs/mynewt-nimble/porting/npl/freertos/include
695686
libs/mynewt-nimble/nimble/include
696687
libs/mynewt-nimble/porting/nimble/include
@@ -781,7 +772,7 @@ link_directories(
781772

782773

783774
set(COMMON_FLAGS -MP -MD -mthumb -mabi=aapcs -ftree-vrp -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin -fshort-enums -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fstack-usage -fno-exceptions -fno-non-call-exceptions)
784-
set(WARNING_FLAGS -Wall -Wextra -Warray-bounds=2 -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wformat-nonliteral -Wno-missing-field-initializers -Wno-unknown-pragmas -Wno-expansion-to-defined -Wreturn-type -Werror=return-type)
775+
set(WARNING_FLAGS -Wall -Wextra -Warray-bounds=2 -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wformat-nonliteral -Wno-missing-field-initializers -Wno-unknown-pragmas -Wno-expansion-to-defined -Wreturn-type -Werror=return-type -Werror)
785776
set(DEBUG_FLAGS -Og -g3)
786777
set(RELEASE_FLAGS -Os)
787778
set(CXX_FLAGS -fno-rtti)

src/components/alarm/AlarmController.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,4 @@ void AlarmController::StopAlerting() {
104104
// set next instance
105105
ScheduleAlarm();
106106
}
107-
systemTask->PushMessage(System::Messages::StopRinging);
108107
}

src/components/battery/BatteryController.cpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "components/battery/BatteryController.h"
2-
#include "components/utility/LinearApproximation.h"
2+
#include "utility/LinearApproximation.h"
33
#include "drivers/PinMap.h"
44
#include <hal/nrf_gpio.h>
55
#include <nrfx_saadc.h>
@@ -81,20 +81,10 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const* p_event) {
8181
newPercent = std::min(approx.GetValue(voltage), isCharging ? uint8_t {99} : uint8_t {100});
8282
}
8383

84-
if (isPowerPresent) {
85-
batteryLowNotified = false;
86-
}
87-
8884
if ((isPowerPresent && newPercent > percentRemaining) || (!isPowerPresent && newPercent < percentRemaining) || firstMeasurement) {
8985
firstMeasurement = false;
9086
percentRemaining = newPercent;
9187
systemTask->PushMessage(System::Messages::BatteryPercentageUpdated);
92-
93-
// warn about low battery when not charging and below threshold
94-
if (BatteryIsLow() && !isPowerPresent && !batteryLowNotified) {
95-
systemTask->PushMessage(System::Messages::LowBattery);
96-
batteryLowNotified = true;
97-
}
9888
}
9989

10090
nrfx_saadc_uninit();

src/components/battery/BatteryController.h

-7
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ namespace Pinetime {
1818
return percentRemaining;
1919
}
2020

21-
bool BatteryIsLow() const {
22-
return percentRemaining <= lowBatteryThreshold;
23-
}
24-
2521
uint16_t Voltage() const {
2622
return voltage;
2723
}
@@ -43,7 +39,6 @@ namespace Pinetime {
4339
static constexpr nrf_saadc_input_t batteryVoltageAdcInput = NRF_SAADC_INPUT_AIN7;
4440
uint16_t voltage = 0;
4541
uint8_t percentRemaining = 0;
46-
bool batteryLowNotified = false;
4742

4843
bool isFull = false;
4944
bool isCharging = false;
@@ -55,8 +50,6 @@ namespace Pinetime {
5550
void SaadcEventHandler(nrfx_saadc_evt_t const* p_event);
5651
static void AdcCallbackStatic(nrfx_saadc_evt_t const* event);
5752

58-
static constexpr uint8_t lowBatteryThreshold {15};
59-
6053
bool isReading = false;
6154

6255
Pinetime::System::SystemTask* systemTask = nullptr;

0 commit comments

Comments
 (0)