Skip to content

Commit de69905

Browse files
JF002Gitea
authored andcommitted
Merge branch 'develop' of JF/PineTime into master
2 parents a80e782 + 7c9513b commit de69905

208 files changed

Lines changed: 11553 additions & 10979 deletions

File tree

Some content is hidden

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

.clang-format

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ AlwaysBreakAfterDefinitionReturnType: None
2121
AlwaysBreakAfterReturnType: None
2222
AlwaysBreakBeforeMultilineStrings: false
2323
AlwaysBreakTemplateDeclarations: MultiLine
24-
BinPackArguments: true
25-
BinPackParameters: true
24+
BinPackArguments: false
25+
BinPackParameters: false
2626
BraceWrapping:
2727
AfterCaseLabel: false
2828
AfterClass: false
@@ -52,14 +52,14 @@ BreakStringLiterals: true
5252
ColumnLimit: 140
5353
CommentPragmas: '^ IWYU pragma:'
5454
CompactNamespaces: false
55-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
55+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
5656
ConstructorInitializerIndentWidth: 2
5757
ContinuationIndentWidth: 2
5858
Cpp11BracedListStyle: true
5959
DeriveLineEnding: false
6060
DerivePointerAlignment: false
6161
DisableFormat: false
62-
ExperimentalAutoDetectBinPacking: false
62+
ExperimentalAutoDetectBinPacking: true
6363
FixNamespaceComments: false
6464
ForEachMacros:
6565
- foreach
@@ -90,10 +90,6 @@ MacroBlockBegin: ''
9090
MacroBlockEnd: ''
9191
MaxEmptyLinesToKeep: 1
9292
NamespaceIndentation: All
93-
ObjCBinPackProtocolList: Auto
94-
ObjCBlockIndentWidth: 2
95-
ObjCSpaceAfterProperty: false
96-
ObjCSpaceBeforeProtocolList: true
9793
PenaltyBreakAssignment: 2
9894
PenaltyBreakBeforeFirstCallParameter: 19
9995
PenaltyBreakComment: 300

.clang-tidy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ Checks: '*,
2222
-hicpp-no-assembler,
2323
-hicpp-avoid-c-arrays,
2424
-hicpp-uppercase-literal-suffix,
25+
-hicpp-no-array-decay,
2526
-cert-err58-cpp,
26-
-cert-err60-cpp'
27+
-cert-err60-cpp'
28+
CheckOptions:
29+
- key: readability-function-cognitive-complexity.Threshold
30+
value: 100

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
.idea/
2+
# Python virtual environment for DFU images
3+
.venv/
4+
25
# CMake
36
cmake-build-*
47
cmake-*

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.10)
2-
project(pinetime VERSION 1.0.0 LANGUAGES C CXX ASM)
2+
project(pinetime VERSION 1.1.0 LANGUAGES C CXX ASM)
33

44
set(CMAKE_C_STANDARD 99)
55
set(CMAKE_CXX_STANDARD 14)
@@ -55,10 +55,22 @@ if(BUILD_DFU)
5555
set(BUILD_DFU true)
5656
endif()
5757

58+
set(PROJECT_GIT_COMMIT_HASH "")
59+
60+
execute_process(COMMAND git rev-parse --short HEAD
61+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
62+
OUTPUT_VARIABLE PROJECT_GIT_COMMIT_HASH
63+
RESULT_VARIABLE PROJECT_GIT_COMMIT_HASH_SUCCESS)
64+
65+
string(STRIP ${PROJECT_GIT_COMMIT_HASH} PROJECT_GIT_COMMIT_HASH)
66+
67+
message("PROJECT_GIT_COMMIT_HASH_SUCCESS? " ${PROJECT_GIT_COMMIT_HASH_SUCCESS})
68+
5869
message("BUILD CONFIGURATION")
5970
message("-------------------")
6071
message(" * Version : " ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
6172
message(" * Toolchain : " ${ARM_NONE_EABI_TOOLCHAIN_PATH})
73+
message(" * GitRef(S) : " ${PROJECT_GIT_COMMIT_HASH})
6274
message(" * NRF52 SDK : " ${NRF5_SDK_PATH})
6375
set(PROGRAMMER "???")
6476
if(USE_JLINK)

README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ The goal of this project is to design an open-source firmware for the Pinetime s
2424

2525
## Overview
2626

27-
![Pinetime screens](images/0.14.0/collage1.png "PinetimeScreens")
28-
![Pinetime screens](images/0.14.0/collage2.png "PinetimeScreens")
27+
![Pinetime screens](images/1.0.0/collage.png "PinetimeScreens")
2928

3029
As of now, here is the list of achievements of this project:
3130

@@ -37,32 +36,47 @@ As of now, here is the list of achievements of this project:
3736
- Heart rate measurements
3837
- Step counting
3938
- Wake-up on wrist rotation
40-
- Multiple 'apps' :
41-
* Clock (displays the date, time, battery level, ble connection status, heart rate)
42-
* System info (displays various info : BLE MAC, build date/time, uptime, version,...)
43-
* Brightess (allows the user to configure the brightness of the display)
39+
- Quick actions
40+
* Disable vibration on notification
41+
* Brightness settings
42+
* Flashlight
43+
* Settings
44+
- 2 watch faces:
45+
* Digital
46+
* Analog
47+
- Multiple 'apps' :
4448
* Music (control the playback of the music on your phone)
4549
* Heart rate (controls the heart rate sensor and display current heartbeat)
4650
* Navigation (displays navigation instructions coming from the companion app)
4751
* Notification (displays the last notification received)
4852
* Paddle (single player pong-like game)
4953
* Two (2048 clone game)
5054
* Stopwatch (with all the necessary functions such as play, pause, lap, stop)
55+
* Motion sensor and step counter (displays the number of steps and the state of the motion sensor in real-time)
56+
- User settings:
57+
* Display timeout
58+
* Wake-up condition
59+
* Time format (12/24h)
60+
* Default watch face
61+
* Battery status
62+
* Firmware validation
63+
* System information
5164
- Supported by 3 companion apps (development is in progress):
5265
* [Gadgetbridge](https://codeberg.org/Freeyourgadget/Gadgetbridge/) (on Android)
5366
* [Amazfish](https://openrepos.net/content/piggz/amazfish) (on SailfishOS and Linux)
5467
* [Siglo](https://github.com/alexr4535/siglo) (on Linux)
5568
* **[Experimental]** [WebBLEWatch](https://hubmartin.github.io/WebBLEWatch/) Synchronize time directly from your web browser. [video](https://youtu.be/IakiuhVDdrY)
56-
- **[Experimental]** OTA (Over-the-air) update via BLE
57-
- **[Experimental]** Bootloader based on [MCUBoot](https://juullabs-oss.github.io/mcuboot/)
69+
- OTA (Over-the-air) update via BLE
70+
- [Bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader) based on [MCUBoot](https://juullabs-oss.github.io/mcuboot/)
5871

5972
## Documentation
6073

6174
### Getting started
62-
- [Flash, upgrade (OTA), time synchronization,...](doc/gettingStarted/gettingStarted.md)
75+
- [Getting started with InfiniTime 1.0 (quick user guide, update bootloader and InfiniTime,...)](doc/gettingStarted/gettingStarted-1.0.md)
76+
- [Flash, upgrade (OTA), time synchronization,...](doc/gettingStarted/ota-gadgetbridge-nrfconnect.md)
6377

6478
### Develop
65-
- [Generate the fonts and symbols](src/displayapp/fonts/Readme.md)
79+
- [Generate the fonts and symbols](src/displayapp/fonts/README.md)
6680
- [Creating a stopwatch in Pinetime(article)](https://pankajraghav.com/2021/04/03/PINETIME-STOPCLOCK.html)
6781

6882
### Build, flash and debug

doc/buildAndProgram.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
To build this project, you'll need:
44
- 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)
55
- 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)
6+
- The `cbor` and `intelhex` modules for Python 3
67
- A reasonably recent version of CMake (I use 3.16.5)
78

89
## Build steps

doc/contribute.md

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,68 @@
22
## Report bugs
33
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...
44
## Write and improve documentation
5-
Documentation might be incomplete, or not clear enough, and it is always possible to improve it with better wording, pictures, photo, video,...
5+
Documentation might be incomplete, or not clear enough, and it is always possible to improve it with better wording, pictures, photo, video,...
66

77
As the documentation is part of the source code, you can submit your improvements to the documentation by submitting a pull request (see below).
88
## Fix bugs, add functionalities and improve the code
99
You want to fix a bug, add a cool new functionality or improve the code? See *How to submit a pull request below*.
1010
## Spread the word
11-
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!
11+
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!
1212

1313
# How to submit a pull request ?
14-
Your contribution is more than welcome!
1514

16-
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.
15+
## TL;DR
16+
- Create a branch from develop;
17+
- Work on a single subject in this branch. Create multiple branches/pulls-requests if you want to work on multiple subjects (bugs, features,...);
18+
- Test your modifications on the actual hardware;
19+
- Check the code formatting against our coding conventions and [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy);
20+
- Clean your code and remove files that are not needed;
21+
- Write documentation related to your new feature is applicable;
22+
- Create the pull-request and write a great description about it : what does your PR do, why, how,... Add pictures and video if possible;
23+
- Wait for someone to review your PR and take part in the review process;
24+
- Your PR will eventually be merged :)
1725

18-
When your feature branch is ready, make sure it actually works and do not forget to write documentation about it if necessary.
26+
Your contribution is more than welcome!
1927

20-
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.
28+
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.
2129

22-
Other contributors can post comments about the pull request, maybe ask for more info or adjustements in the code.
30+
When your feature branch is ready, **make sure it actually works** and **do not forget to write documentation** about it if it's relevant.
2331

24-
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.
32+
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.
33+
34+
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.
35+
36+
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,...
37+
38+
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.
39+
40+
Other contributors can post comments about the pull request, maybe ask for more info or adjustments in the code.
41+
42+
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.
43+
44+
## Why all these rules?
45+
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**.
46+
47+
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.
48+
49+
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.
50+
51+
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.
52+
53+
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.
54+
55+
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.
2556

2657
# Coding convention
2758
## Language
2859
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.
2960

30-
It's OK to include C code if this code comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK.
61+
It's OK to include C code if this code comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK.
3162

3263
## Coding style
33-
The most important rule to follow is to try to keep the code as easy to read and maintain as possible.
64+
The most important rule to follow is to try to keep the code as easy to read and maintain as possible.
3465

35-
- **Identation** : 2 spaces, no tabulation
66+
- **Indentation** : 2 spaces, no tabulation
3667
- **Opening brace** at the end of the line
3768
- **Naming** : Choose self-describing variable name
3869
- **class** : PascalCase

doc/gettingStarted/appmenu-071.jpg

107 KB
Loading

doc/gettingStarted/appmenu.jpg

118 KB
Loading
157 KB
Loading

0 commit comments

Comments
 (0)