Skip to content

Commit 2a299fe

Browse files
committed
Merge branch 'develop' into pinmap
2 parents 0d083a2 + df8ea7f commit 2a299fe

25 files changed

Lines changed: 365 additions & 342 deletions

.vscode/launch.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,25 @@
4040
"break main",
4141
"continue"
4242
]
43+
},
44+
{
45+
"cwd": "${workspaceRoot}",
46+
// TODO: find better way to get latest build filename
47+
"executable": "./build/src/pinetime-app-1.3.0.out",
48+
"name": "Debug OpenOCD ST-LINK pinetime-app-1.3.0.out",
49+
"request": "launch",
50+
"type": "cortex-debug",
51+
"showDevDebugOutput": false,
52+
"servertype": "openocd",
53+
"runToMain": true,
54+
// Only use armToolchainPath if your arm-none-eabi-gdb is not in your path (some GCC packages does not contain arm-none-eabi-gdb)
55+
"armToolchainPath": "${workspaceRoot}/../gcc-arm-none-eabi-9-2020-q2-update/bin",
56+
"svdFile": "${workspaceRoot}/nrf52.svd",
57+
"configFiles": [
58+
"interface/stlink.cfg",
59+
"target/nrf52.cfg"
60+
],
4361
}
4462

4563
]
46-
}
64+
}

CONTRIBUTING.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
doc/contribute.md

doc/contribute.md

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,89 @@
11
# How to contribute?
2+
23
## Report bugs
3-
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...
4+
5+
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...
6+
47
## Write and improve documentation
8+
59
Documentation might be incomplete, or not clear enough, and it is always possible to improve it with better wording, pictures, photo, video,...
610

711
As the documentation is part of the source code, you can submit your improvements to the documentation by submitting a pull request (see below).
12+
813
## Fix bugs, add functionalities and improve the code
14+
915
You want to fix a bug, add a cool new functionality or improve the code? See *How to submit a pull request below*.
16+
1017
## Spread the word
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!
18+
19+
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!
1220

1321
# How to submit a pull request ?
1422

1523
## TL;DR
24+
1625
- Create a branch from develop;
1726
- Work on a single subject in this branch. Create multiple branches/pulls-requests if you want to work on multiple subjects (bugs, features,...);
1827
- Test your modifications on the actual hardware;
1928
- Check the code formatting against our coding conventions and [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy);
2029
- 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;
30+
- Write documentation related to your new feature if applicable;
31+
- Create a pull request and write a great description about it : what does your PR do, why, how,... Add pictures and video if possible;
2332
- Wait for someone to review your PR and take part in the review process;
2433
- Your PR will eventually be merged :)
2534

26-
Your contribution is more than welcome!
35+
Your contributions are more than welcome!
2736

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.
37+
If you want to fix a bug, add 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 for each topic.
2938

3039
When your feature branch is ready, **make sure it actually works** and **do not forget to write documentation** about it if it's relevant.
3140

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.
41+
**Creating a pull request containing modifications that haven't been tested is strongly discouraged.** 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.
3342

3443
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.
3544

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,...
45+
Don't forget to check the files you are going to commit and remove those which aren't necessary (config files from your IDE, for example). Remove old comments, commented code,...
3746

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.
47+
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 it is 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.
3948

4049
Other contributors can post comments about the pull request, maybe ask for more info or adjustments in the code.
4150

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.
51+
Once the pull request is reviewed and accepted, it'll be merged into **develop** and will be released in the next version of the firmware.
4352

4453
## 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**.
4654

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.
55+
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. Everything you do to make reviewing easier will **get your PR merged faster**.
4856

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.
57+
When reviewing PRs, 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.
5058

51-
We do our best to keep the code as consistent as possible, and that means 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.
59+
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, so we won't be able to merge the PR because of the changes that are not accepted.
5260

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.
61+
We do our best to keep the code as consistent as possible. If the formatting of the code in your PR is not consistent with our code base, we'll ask you to review it, which will take more time.
5462

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.
63+
The last step of the review consists of **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.
64+
65+
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, so it's good practice to try to reduce them as much as possible by following those simple rules.
5666

5767
# Coding convention
68+
5869
## Language
59-
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.
6070

61-
It's OK to include C code if this code comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK.
71+
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.
72+
73+
C code is accepted if it comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK.
6274

6375
## Coding style
76+
6477
The most important rule to follow is to try to keep the code as easy to read and maintain as possible.
6578

79+
Using an autoformatter is highly recommended, but make sure it's configured properly.
80+
81+
There are preconfigured autoformatter rules for:
82+
83+
* CLion (IntelliJ) in .idea/codeStyles/Project.xml
84+
85+
If there are no preconfigured rules for your IDE, you can use one of the existing ones to configure your IDE.
86+
6687
- **Indentation** : 2 spaces, no tabulation
6788
- **Opening brace** at the end of the line
6889
- **Naming** : Choose self-describing variable name

doc/ui/example.png

10.4 KB
Loading

doc/ui_guidelines.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# UI design guidelines
2+
3+
- Align objects all the way to the edge or corner
4+
- Buttons should generally be at least 50px high
5+
- Buttons should generally be on the bottom edge
6+
- Make interactable objects **big**
7+
- Recommendations for inner padding, aka distance between buttons:
8+
- When aligning 4 objects: 4px, e.g. Settings
9+
- When aligning 3 objects: 6px, e.g. App list
10+
- When aligning 2 objects: 10px, e.g. Quick settings
11+
- When using a page indicator, leave 8px for it on the right side
12+
- It is acceptable to leave 8px on the left side as well to center the content
13+
- Top bar takes at least 20px + padding
14+
- Top bar right icons move 8px to the left when using a page indicator
15+
16+
![example layouts](./ui/example.png)

src/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ target_compile_options(${EXECUTABLE_NAME} PUBLIC
840840

841841
set_target_properties(${EXECUTABLE_NAME} PROPERTIES
842842
SUFFIX ".out"
843-
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_FILE_NAME}.map"
843+
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections -Wl,--print-memory-usage --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_FILE_NAME}.map"
844844
)
845845

846846
add_custom_command(TARGET ${EXECUTABLE_NAME}
@@ -870,7 +870,7 @@ target_compile_options(${EXECUTABLE_MCUBOOT_NAME} PUBLIC
870870

871871
set_target_properties(${EXECUTABLE_MCUBOOT_NAME} PROPERTIES
872872
SUFFIX ".out"
873-
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT_MCUBOOT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_MCUBOOT_FILE_NAME}.map"
873+
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT_MCUBOOT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections -Wl,--print-memory-usage --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_MCUBOOT_FILE_NAME}.map"
874874
)
875875

876876
add_custom_command(TARGET ${EXECUTABLE_MCUBOOT_NAME}
@@ -907,7 +907,7 @@ target_compile_options(${EXECUTABLE_RECOVERY_NAME} PUBLIC
907907

908908
set_target_properties(${EXECUTABLE_RECOVERY_NAME} PROPERTIES
909909
SUFFIX ".out"
910-
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_RECOVERY_FILE_NAME}.map"
910+
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections -Wl,--print-memory-usage --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_RECOVERY_FILE_NAME}.map"
911911
)
912912

913913
add_custom_command(TARGET ${EXECUTABLE_RECOVERY_NAME}
@@ -937,7 +937,7 @@ target_compile_options(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PUBLIC
937937

938938
set_target_properties(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PROPERTIES
939939
SUFFIX ".out"
940-
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_GRAPHICS_FILE_NAME}.map"
940+
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections -Wl,--print-memory-usage --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_GRAPHICS_FILE_NAME}.map"
941941
)
942942

943943
add_custom_command(TARGET ${EXECUTABLE_RECOVERY_MCUBOOT_NAME}
@@ -978,7 +978,7 @@ add_dependencies(${EXECUTABLE_RECOVERYLOADER_NAME} ${EXECUTABLE_RECOVERY_MCUBOOT
978978

979979
set_target_properties(${EXECUTABLE_RECOVERYLOADER_NAME} PROPERTIES
980980
SUFFIX ".out"
981-
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_RECOVERYLOADER_FILE_NAME}.map"
981+
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections -Wl,--print-memory-usage --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_RECOVERYLOADER_FILE_NAME}.map"
982982
)
983983

984984
add_custom_command(TARGET ${EXECUTABLE_RECOVERYLOADER_NAME}
@@ -1011,7 +1011,7 @@ add_dependencies(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} ${EXECUTABLE_RECOVERY
10111011

10121012
set_target_properties(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PROPERTIES
10131013
SUFFIX ".out"
1014-
LINK_FLAGS "-mthumb -mabi=aapcs -std=gnu++98 -std=c99 -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT_MCUBOOT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.map"
1014+
LINK_FLAGS "-mthumb -mabi=aapcs -std=gnu++98 -std=c99 -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT_MCUBOOT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections -Wl,--print-memory-usage --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.map"
10151015
)
10161016

10171017
add_custom_command(TARGET ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME}

0 commit comments

Comments
 (0)