Skip to content

Commit e823c8e

Browse files
JF002Gitea
authored and
Gitea
committed
Merge branch 'develop' of JF/PineTime into master
2 parents 286690e + b56c5f2 commit e823c8e

File tree

189 files changed

+4698
-69390
lines changed

Some content is hidden

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

189 files changed

+4698
-69390
lines changed

.devcontainer/README.md

+10-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# VS Code Dev Container
2-
This is a docker-based interactive development environment using VS Code and Docker Dev Containers removing the need to install any tools locally*
3-
42

3+
This is a docker-based interactive development environment using VS Code and Docker Dev Containers removing the need to install any tools locally\*
54

65
## Requirements
76

@@ -16,45 +15,41 @@ This is a docker-based interactive development environment using VS Code and Doc
1615

1716
1. Clone InfiniTime and update submodules
1817
2. Launch VS Code
19-
3. Open InfiniTime directory,
20-
4. Allow VS Code to open folder with devcontainer.
18+
3. Open InfiniTime directory,
19+
4. Allow VS Code to open folder with devcontainer.
2120

22-
After this the environment will be built if you do not currently have a container setup, it will install all the necessary tools and extra VSCode extensions.
21+
After this the environment will be built if you do not currently have a container setup, it will install all the necessary tools and extra VSCode extensions.
2322

2423
In order to build InfiniTime we need to run the initial submodule init and CMake commands.
2524

26-
#### Manually
25+
#### Manually
2726

28-
You can use the VS Code terminal to run the CMake commands as outlined in the [build instructions](blob/develop/doc/buildAndProgram.md)
27+
You can use the VS Code terminal to run the CMake commands as outlined in the [build instructions](blob/develop/doc/buildAndProgram.md)
2928

3029
#### Script
3130

3231
The dev environment comes with some scripts to make this easier, They are located in /opt/.
3332

34-
There are also VS Code tasks provided should you desire to use those.
33+
There are also VS Code tasks provided should you desire to use those.
3534

3635
The task "update submodules" will update the git submodules
3736

38-
39-
4037
### Build
4138

4239
You can use the build.sh script located in /opt/
4340

4441
CMake is also configured and controls for the CMake plugin are available in VS Code
4542

46-
47-
4843
### Debugging
4944

5045
Docker on windows does not support passing USB devices to the underlying WSL2 subsystem, To get around this we use OpenOCD in server mode running on the host.
5146

5247
`openocd -f <yourinterface> -f <nrf52.cfg target file>`
5348

54-
This will launch OpenOCD in server mode and attach it to the MCU.
49+
This will launch OpenOCD in server mode and attach it to the MCU.
5550

5651
The default launch.json file expects OpenOCD to be listening on port 3333, edit if needed
5752

58-
5953
## Current Issues
60-
Currently WSL2 Has some real performance issues with IO on a windows host. Accessing files on the virtualized filesystem is much faster. Using VS Codes "clone in container" feature of the Remote - Containers will get around this. After the container is built you will need to update the submodules and follow the build instructions like normal
54+
55+
Currently WSL2 Has some real performance issues with IO on a windows host. Accessing files on the virtualized filesystem is much faster. Using VS Codes "clone in container" feature of the Remote - Containers will get around this. After the container is built you will need to update the submodules and follow the build instructions like normal

.devcontainer/build.sh

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ CmakeGenerate() {
6060

6161
cmake -G "Unix Makefiles" \
6262
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
63-
-DUSE_OPENOCD=1 \
6463
-DARM_NONE_EABI_TOOLCHAIN_PATH="$TOOLS_DIR/$GCC_ARM_VER" \
6564
-DNRF5_SDK_PATH="$TOOLS_DIR/$NRF_SDK_VER" \
6665
"$SOURCES_DIR"

.github/workflows/docker.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build and push Docker image
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
paths:
7+
- 'docker/**'
8+
pull_request:
9+
branches: [ develop ]
10+
paths:
11+
- 'docker/**'
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
env:
19+
USERNAME: infinitime
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Log in to Docker Hub
24+
if: github.event_name != 'pull_request'
25+
uses: docker/login-action@v2
26+
with:
27+
username: ${{ secrets.DOCKER_HUB_LOGIN_USERNAME }}
28+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
29+
30+
- name: Set up Docker metadata
31+
id: meta
32+
uses: docker/metadata-action@v4
33+
with:
34+
images: |
35+
${{ secrets.DOCKER_HUB_IMAGE_USERNAME || env.USERNAME }}/infinitime-build
36+
tags: |
37+
type=sha
38+
type=raw,value=latest
39+
40+
- name: Set up QEMU
41+
uses: docker/setup-qemu-action@v2
42+
43+
- name: Set up Docker Buildx
44+
id: buildx
45+
uses: docker/setup-buildx-action@v2
46+
47+
- name: Build and push
48+
if: github.event_name != 'pull_request'
49+
uses: docker/build-push-action@v3
50+
with:
51+
context: ./docker/
52+
file: ./docker/Dockerfile
53+
platforms: linux/amd64,linux/arm64
54+
builder: ${{ steps.buildx.outputs.name }}
55+
push: true
56+
tags: ${{ steps.meta.outputs.tags }}
57+
labels: ${{ steps.meta.outputs.labels }}
58+
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_IMAGE_USERNAME || env.USERNAME }}/infinitime-build:buildcache
59+
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_IMAGE_USERNAME || env.USERNAME }}/infinitime-build:buildcache,mode=max
60+
61+
- name: Build
62+
if: github.event_name == 'pull_request'
63+
uses: docker/build-push-action@v3
64+
with:
65+
context: ./docker/
66+
file: ./docker/Dockerfile
67+
platforms: linux/amd64,linux/arm64
68+
builder: ${{ steps.buildx.outputs.name }}
69+
push: false
70+
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_IMAGE_USERNAME || env.USERNAME }}/infinitime-build:buildcache

.github/workflows/format.yml

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

33
on:
44
pull_request:
5-
branches: [ master, develop ]
5+
branches: [ develop ]
66
paths:
77
- '**.cpp'
88
- '**.h'
@@ -17,9 +17,8 @@ jobs:
1717
with:
1818
fetch-depth: 1000
1919

20-
- name: Configure git
21-
run: |
22-
git fetch origin "$GITHUB_BASE_REF":"$GITHUB_BASE_REF" --depth=1000
20+
- name: Fetch base branch
21+
run: git fetch origin "$GITHUB_BASE_REF":"$GITHUB_BASE_REF"
2322

2423
- name: Install clang-format
2524
run: |
@@ -35,3 +34,37 @@ jobs:
3534
with:
3635
name: Patches
3736
path: ./*.patch
37+
test-clang-tidy:
38+
runs-on: ubuntu-latest
39+
container:
40+
image: infinitime/infinitime-build
41+
steps:
42+
# This workaround fixes the error "unsafe repository (REPO is owned by someone else)".
43+
# See https://github.com/actions/checkout/issues/760 and https://github.com/actions/checkout/issues/766
44+
# The fix in "actions/checkout@v2" was not sufficient as the build process also uses git (to get the current
45+
# commit hash, for example).
46+
- name: Workaround permission issues
47+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
48+
- name: Checkout source files
49+
uses: actions/checkout@v3
50+
with:
51+
submodules: recursive
52+
fetch-depth: 1000
53+
- name: Fetch base branch
54+
run: git fetch origin "$GITHUB_BASE_REF":"$GITHUB_BASE_REF"
55+
- name: Install clang-tidy
56+
run: |
57+
apt-get update
58+
apt-get -y install clang-tidy-12
59+
- name: Prepare environment
60+
shell: bash
61+
env:
62+
SOURCES_DIR: .
63+
run: |
64+
. docker/build.sh
65+
GetGcc
66+
# I guess these already exist inside the docker?
67+
#GetNrfSdk
68+
#GetMcuBoot
69+
CmakeGenerate
70+
- run: tests/test-tidy.sh

.github/workflows/lv_sim.yml

-66
This file was deleted.

.github/workflows/main.yml

+56-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
# GitHub Actions Workflow to build FreeRTOS Firmware for PineTime Smart Watch
2-
# See https://lupyuen.github.io/pinetime-rust-mynewt/articles/cloud
3-
# Based on https://github.com/JF002/InfiniTime/blob/master/doc/buildAndProgram.md
4-
# and https://github.com/JF002/InfiniTime/blob/master/bootloader/README.md
5-
6-
name: Build PineTime Firmware
1+
name: CI
72

3+
# Run this workflow whenever the build may be affected
84
on:
95
push:
106
branches: [ master, develop ]
7+
paths-ignore:
8+
- 'doc/**'
9+
- '**.md'
1110
pull_request:
12-
branches: [ master, develop ]
11+
branches: [ develop ]
12+
paths-ignore:
13+
- 'doc/**'
14+
- '**.md'
15+
1316

1417
jobs:
15-
build:
18+
build-firmware:
1619
runs-on: ubuntu-latest
1720
container:
1821
image: infinitime/infinitime-build
@@ -45,3 +48,48 @@ jobs:
4548
with:
4649
name: InfiniTime MCUBoot image ${{ github.head_ref }}
4750
path: ./build/output/pinetime-mcuboot-app-image-*.bin
51+
- name: Upload resources artifacts
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: InfiniTime resources ${{ github.head_ref }}
55+
path: ./build/output/infinitime-resources-*.zip
56+
57+
build-simulator:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Install cmake
61+
uses: lukka/get-cmake@v3.18.3
62+
63+
- name: Install SDL2 development package
64+
run: |
65+
sudo apt-get update
66+
sudo apt-get -y install libsdl2-dev
67+
68+
- name: Install lv_font_conv
69+
run:
70+
npm i -g lv_font_conv@1.5.2
71+
72+
- name: Checkout source files
73+
uses: actions/checkout@v2
74+
with:
75+
submodules: recursive
76+
77+
- name: Get InfiniSim repo
78+
run: |
79+
git clone https://github.com/InfiniTimeOrg/InfiniSim.git --depth 1 --branch main
80+
git -C InfiniSim submodule update --init lv_drivers libpng
81+
82+
- name: CMake
83+
# disable BUILD_RESOURCES as this is already done when building the firmware
84+
run: |
85+
cmake -G Ninja -S InfiniSim -B build_lv_sim -DInfiniTime_DIR="${PWD}" -DBUILD_RESOURCES=OFF
86+
87+
- name: Build simulator executable
88+
run: |
89+
cmake --build build_lv_sim
90+
91+
- name: Upload simulator executable
92+
uses: actions/upload-artifact@v3
93+
with:
94+
name: infinisim-${{ github.head_ref }}
95+
path: build_lv_sim/infinisim

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
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

.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"servertype": "openocd",
5353
"runToMain": true,
5454
// 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-11.2-2022.02-x86_64-arm-none-eabi/bin",
55+
"armToolchainPath": "${workspaceRoot}/../gcc-arm-none-eabi-10.3-2021.10/bin",
5656
"svdFile": "${workspaceRoot}/nrf52.svd",
5757
"configFiles": [
5858
"interface/stlink.cfg",

0 commit comments

Comments
 (0)