Compare commits

..

2 Commits

272 changed files with 10503 additions and 3834 deletions

View File

@ -8,9 +8,9 @@ AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right AlignEscapedNewlines: Right
AlignOperands: Align AlignOperands: Align
AlignTrailingComments: true AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None AllowShortFunctionsOnASingleLine: None
@ -83,8 +83,6 @@ IndentGotoLabels: true
IndentPPDirectives: BeforeHash IndentPPDirectives: BeforeHash
IndentWidth: 2 IndentWidth: 2
IndentWrappedFunctionNames: false IndentWrappedFunctionNames: false
# Requires Clang >= 15, could also cause incorrect code formatting:
# InsertBraces: true
JavaScriptQuotes: Leave JavaScriptQuotes: Leave
JavaScriptWrapImports: true JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true KeepEmptyLinesAtTheStartOfBlocks: true

View File

@ -1,8 +0,0 @@
blank_issues_enabled: true
contact_links:
- name: PineTime community chat (Matrix)
url: https://app.element.io/#/room/#pinetime:matrix.org
about: Please ask questions about PineTime here.
- name: PineTime developers chat (Matrix)
url: https://app.element.io/#/room/#pinetime-dev:matrix.org
about: Please ask questions about PineTime development here.

View File

@ -1,37 +0,0 @@
name: Code formatting
on:
pull_request:
branches: [ master, develop ]
paths:
- '**.cpp'
- '**.h'
- '!src/libs/**'
- '!src/FreeRTOS/**'
jobs:
test-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1000
- name: Configure git
run: |
git fetch origin "$GITHUB_BASE_REF":"$GITHUB_BASE_REF" --depth=1000
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get -y install clang-format-12
- name: Check formatting
run: tests/test-format.sh
- name: Upload patches
uses: actions/upload-artifact@v3
if: failure()
with:
name: Patches
path: ./*.patch

View File

@ -1,66 +0,0 @@
# GitHub Actions Workflow to build Simulator for PineTime Smart Watch LVGL Interface
name: Build PineTime LVGL Simulator
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:
#########################################################################################
# Download and Install Dependencies
- name: Install cmake
uses: lukka/get-cmake@v3.18.3
- name: Install SDL2 development package
run: |
sudo apt-get update
sudo apt-get -y install libsdl2-dev
- name: Install lv_font_conv
run:
npm i -g lv_font_conv@1.5.2
#########################################################################################
# Checkout
- name: Checkout source files
uses: actions/checkout@v2
with:
submodules: recursive
#########################################################################################
# get InfiniSim repo
- name: Get InfiniSim repo
run: |
git clone https://github.com/InfiniTimeOrg/InfiniSim.git --depth 1 --branch main
git -C InfiniSim submodule update --init lv_drivers libpng
#########################################################################################
# CMake
- name: CMake
run: |
cmake -G Ninja -S InfiniSim -B build_lv_sim -DInfiniTime_DIR="${PWD}"
#########################################################################################
# Build and Upload simulator
- name: Build simulator executable
run: |
cmake --build build_lv_sim
- name: Upload simulator executable
uses: actions/upload-artifact@v3
with:
name: infinisim-${{ github.head_ref }}
path: build_lv_sim/infinisim

View File

@ -3,45 +3,168 @@
# Based on https://github.com/JF002/InfiniTime/blob/master/doc/buildAndProgram.md # Based on https://github.com/JF002/InfiniTime/blob/master/doc/buildAndProgram.md
# and https://github.com/JF002/InfiniTime/blob/master/bootloader/README.md # and https://github.com/JF002/InfiniTime/blob/master/bootloader/README.md
# Name of this Workflow
name: Build PineTime Firmware name: Build PineTime Firmware
# When to run this Workflow...
on: on:
# Run this Workflow when files are updated (Pushed) in the "master" and "develop" Branch
push: push:
branches: [ master, develop ] branches: [ master, develop ]
# Also run this Workflow when a Pull Request is created or updated in the "master" and "develop" Branch
pull_request: pull_request:
branches: [ master, develop ] branches: [ master, develop ]
# Steps to run for the Workflow
jobs: jobs:
build: build:
# Run these steps on Ubuntu
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: infinitime/infinitime-build
steps: steps:
# This workaround fixes the error "unsafe repository (REPO is owned by someone else)".
# See https://github.com/actions/checkout/issues/760 and https://github.com/actions/checkout/issues/766 #########################################################################################
# The fix in "actions/checkout@v2" was not sufficient as the build process also uses git (to get the current # Download and Cache Dependencies
# commit hash, for example).
- name: Workaround permission issues - name: Install cmake
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" uses: lukka/get-cmake@v3.18.3
- name: Check cache for Embedded Arm Toolchain arm-none-eabi-gcc
id: cache-toolchain
uses: actions/cache@v2
env:
cache-name: cache-toolchain-9-2020-q2
with:
path: ${{ runner.temp }}/arm-none-eabi
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install Embedded Arm Toolchain arm-none-eabi-gcc
if: steps.cache-toolchain.outputs.cache-hit != 'true' # Install toolchain if not found in cache
uses: fiam/arm-none-eabi-gcc@v1.0.4
with:
# GNU Embedded Toolchain for Arm release name, in the V-YYYY-qZ format (e.g. "9-2019-q4")
release: 9-2020-q2
# Directory to unpack GCC to. Defaults to a temporary directory.
directory: ${{ runner.temp }}/arm-none-eabi
- name: Check cache for nRF5 SDK
id: cache-nrf5sdk
uses: actions/cache@v2
env:
cache-name: cache-nrf5sdk
with:
path: ${{ runner.temp }}/nrf5_sdk
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install nRF5 SDK
if: steps.cache-nrf5sdk.outputs.cache-hit != 'true' # Install SDK if not found in cache
run: |
cd ${{ runner.temp }}
curl https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip -o nrf5_sdk.zip
unzip nrf5_sdk.zip
mv nRF5_SDK_15.3.0_59ac345 nrf5_sdk
- name: Check cache for MCUBoot
id: cache-mcuboot
uses: actions/cache@v2
env:
cache-name: cache-mcuboot
with:
path: ${{ runner.temp }}/mcuboot
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install MCUBoot
if: steps.cache-mcuboot.outputs.cache-hit != 'true' # Install MCUBoot if not found in cache
run: |
cd ${{ runner.temp }}
git clone --branch v1.7.2 https://github.com/mcu-tools/mcuboot
- name: Install imgtool dependencies
run: |
pip3 install --user -r ${{ runner.temp }}/mcuboot/scripts/requirements.txt
- name: Install adafruit-nrfutil
run: |
pip3 install --user wheel
pip3 install --user setuptools
pip3 install --user adafruit-nrfutil
#########################################################################################
# Checkout
- name: Checkout source files - name: Checkout source files
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
- name: Build
shell: bash - name: Show files
env: run: set ; pwd ; ls -l
SOURCES_DIR: .
run: /opt/build.sh all #########################################################################################
# Unzip the package because Upload Artifact will zip up the files # CMake
- name: CMake
run: |
mkdir -p build
cd build
cmake -G Ninja -DARM_NONE_EABI_TOOLCHAIN_PATH=${{ runner.temp }}/arm-none-eabi -DNRF5_SDK_PATH=${{ runner.temp }}/nrf5_sdk -DUSE_OPENOCD=1 -DBUILD_DFU=1 ../
#########################################################################################
# Make and Upload DFU Package
# pinetime-mcuboot-app.img must be flashed at address 0x8000 in the internal flash memory with OpenOCD:
# program image.bin 0x8000
# For Debugging Builds: Remove "make" option "-j" for clearer output. Add "--trace" to see details.
# For Faster Builds: Add "make" option "-j"
- name: Make pinetime-mcuboot-app
run: |
cmake --build build --target pinetime-mcuboot-app
- name: Unzip DFU package - name: Unzip DFU package
run: unzip ./build/output/pinetime-mcuboot-app-dfu-*.zip -d ./build/output/pinetime-mcuboot-app-dfu run: |
- name: Upload DFU artifacts # Unzip the package because Upload Artifact will zip up the files
uses: actions/upload-artifact@v3 unzip build/src/pinetime-mcuboot-app-dfu*.zip -d build/src/pinetime-mcuboot-app-dfu
- name: Upload DFU package
uses: actions/upload-artifact@v2
with: with:
name: InfiniTime DFU ${{ github.head_ref }} name: pinetime-mcuboot-app-dfu
path: ./build/output/pinetime-mcuboot-app-dfu/* path: build/src/pinetime-mcuboot-app-dfu/*
- name: Upload MCUBoot image artifacts
uses: actions/upload-artifact@v3 #########################################################################################
# Make and Upload Standalone Firmware
- name: Make pinetime-app
run: |
cmake --build build --target pinetime-app
- name: Upload standalone firmware
uses: actions/upload-artifact@v2
with: with:
name: InfiniTime MCUBoot image ${{ github.head_ref }} name: pinetime-app.out
path: ./build/output/pinetime-mcuboot-app-image-*.bin 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: |
cmake --build build --target pinetime-recovery
#########################################################################################
# Finish
- name: Find output
run: |
find . -name "pinetime-app.*" -ls
find . -name "pinetime-mcuboot-app.*" -ls
# Embedded Arm Toolchain and nRF5 SDK will only be cached if the build succeeds.
# So make sure that the first build always succeeds, e.g. comment out the "Make" step.

2
.vscode/launch.json vendored
View File

@ -52,7 +52,7 @@
"servertype": "openocd", "servertype": "openocd",
"runToMain": true, "runToMain": true,
// Only use armToolchainPath if your arm-none-eabi-gdb is not in your path (some GCC packages does not contain arm-none-eabi-gdb) // Only use armToolchainPath if your arm-none-eabi-gdb is not in your path (some GCC packages does not contain arm-none-eabi-gdb)
"armToolchainPath": "${workspaceRoot}/../gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin", "armToolchainPath": "${workspaceRoot}/../gcc-arm-none-eabi-9-2020-q2-update/bin",
"svdFile": "${workspaceRoot}/nrf52.svd", "svdFile": "${workspaceRoot}/nrf52.svd",
"configFiles": [ "configFiles": [
"interface/stlink.cfg", "interface/stlink.cfg",

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(pinetime VERSION 1.9.0 LANGUAGES C CXX ASM) project(pinetime VERSION 1.7.1 LANGUAGES C CXX ASM)
set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
@ -66,7 +66,7 @@ execute_process(COMMAND git rev-parse --short HEAD
OUTPUT_VARIABLE PROJECT_GIT_COMMIT_HASH OUTPUT_VARIABLE PROJECT_GIT_COMMIT_HASH
RESULT_VARIABLE PROJECT_GIT_COMMIT_HASH_SUCCESS) RESULT_VARIABLE PROJECT_GIT_COMMIT_HASH_SUCCESS)
string(STRIP "${PROJECT_GIT_COMMIT_HASH}" PROJECT_GIT_COMMIT_HASH) string(STRIP ${PROJECT_GIT_COMMIT_HASH} PROJECT_GIT_COMMIT_HASH)
message("PROJECT_GIT_COMMIT_HASH_SUCCESS? " ${PROJECT_GIT_COMMIT_HASH_SUCCESS}) message("PROJECT_GIT_COMMIT_HASH_SUCCESS? " ${PROJECT_GIT_COMMIT_HASH_SUCCESS})
@ -100,7 +100,7 @@ else()
endif() endif()
set(VERSION_EDIT_WARNING "// Do not edit this file, it is automatically generated by CMAKE!") set(VERSION_EDIT_WARNING "// Do not edit this file, it is automatically generated by CMAKE!")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/Version.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docker/post_build.sh.in ${CMAKE_CURRENT_BINARY_DIR}/post_build.sh) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docker/post_build.sh.in ${CMAKE_CURRENT_BINARY_DIR}/post_build.sh)

View File

@ -15,8 +15,7 @@ Fast open-source firmware for the [PineTime smartwatch](https://www.pine64.org/p
- [Gadgetbridge](https://gadgetbridge.org/) (Android) - [Gadgetbridge](https://gadgetbridge.org/) (Android)
- [AmazFish](https://openrepos.net/content/piggz/amazfish/) (SailfishOS) - [AmazFish](https://openrepos.net/content/piggz/amazfish/) (SailfishOS)
- [Siglo](https://github.com/alexr4535/siglo) (Linux) - [Siglo](https://github.com/alexr4535/siglo) (Linux)
- [InfiniLink](https://github.com/InfiniTimeOrg/InfiniLink) **[Experimental]** **[Unmaintained, looking for developers/maintainers]** (iOS) - [InfiniLink](https://github.com/xan-m/InfiniLink) **[Experimental]** (iOS)
- [ITD](https://gitea.arsenm.dev/Arsen6331/itd) (Linux)
## Development ## Development
@ -26,10 +25,6 @@ Fast open-source firmware for the [PineTime smartwatch](https://www.pine64.org/p
- [Creating a stopwatch in Pinetime(article)](https://pankajraghav.com/2021/04/03/PINETIME-STOPCLOCK.html) - [Creating a stopwatch in Pinetime(article)](https://pankajraghav.com/2021/04/03/PINETIME-STOPCLOCK.html)
- [Tips on designing an app UI](doc/ui_guidelines.md) - [Tips on designing an app UI](doc/ui_guidelines.md)
### InfiniSim Simulator
Use the [InfiniSim Simulator](https://github.com/InfiniTimeOrg/InfiniSim) to experience the `InfiniTime` user interface directly on your PC, to shorten the time until you get your hands on a real [PineTime smartwatch](https://www.pine64.org/pinetime/).
Or use it to develop new Watchfaces, new Screens, or quickly iterate on the user interface.
### Contributing ### Contributing
- [How to contribute?](/doc/contribute.md) - [How to contribute?](/doc/contribute.md)
- [Coding conventions](/doc/coding-convention.md) - [Coding conventions](/doc/coding-convention.md)

View File

@ -9,14 +9,14 @@ Integrating a BLE stack for the OTA functionality would have used to much memory
When it is run, this bootloader looks in the SPI flash memory if a new firmware is available. It there is one, it *swaps* the current firmware with the new one (the new one is copied in the main flash memory, and the current one is copied in the SPI flash memory) and run the new one. If the new one fails to run properly, the bootloader is able to revert to the old one and mark the new one as not working. When it is run, this bootloader looks in the SPI flash memory if a new firmware is available. It there is one, it *swaps* the current firmware with the new one (the new one is copied in the main flash memory, and the current one is copied in the SPI flash memory) and run the new one. If the new one fails to run properly, the bootloader is able to revert to the old one and mark the new one as not working.
As this bootloader does not provide any OTA capability, it is not able to actually download a new version of the application. Providing OTA functionality is thus the responsibility of the application firmware. As this bootloader does not provide any OTA capability, it is not able to actually download a new version of the application. Providing OTA functionality is thus the responsability of the application firmware.
# About MCUBoot # About MCUBoot
MCUBoot is run at boot time. In normal operation, it just jumps to the reset handler of the application firmware to run it. Once the application firmware is running, MCUBoot does not run at all. MCUBoot is run at boot time. In normal operation, it just jumps to the reset handler of the application firmware to run it. Once the application firmware is running, MCUBoot does not run at all.
![MCUBoot boot sequence diagram](../doc/bootloader/boot.png "MCUBoot boot sequence diagram") ![MCUBoot boot sequence diagram](../doc/bootloader/boot.png "MCUBoot boot sequence diagram")
But MCUBoot does much more than that : it can upgrade the firmware that is currently running by a new one, and it is also able to revert to the previous version of the firmware in case the new one does not run properly. But MCUBoot does much more than that : it can upgrade the firmware that is currently running by a new one, and it is also able to revert to the previous version of the firmware in case the new one does not run propertly.
To do this, it uses 2 memory 'slots' : To do this, it uses 2 memory 'slots' :
- **The primary slot** : it contains the current firmware, the one that will be executed by MCUBoot - **The primary slot** : it contains the current firmware, the one that will be executed by MCUBoot
@ -40,7 +40,7 @@ This chapter describes degraded cases that are handled by our bootloader and tho
Case | Current bootloader | Solution Case | Current bootloader | Solution
-----|--------------------|---------------------------------------------- -----|--------------------|----------------------------------------------
Data got corrupted during file transfer | [OK] Application firmware does a CRC check before applying the update, and does not proceed if it fails. | N/A Data got corrupted during file transfer | [OK] Application firmware does a CRC check before applying the update, and does not proceed if it fails. | N/A
New firmware does not run at all (bad file) (1) | [NOK] MCU executes unknown instructions and will most likely end up in an infinite loop or freeze in an error handler. The bootloader does not run, it can do nothing, the MCU is stuck until next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset. New firmware does not run at all (bad file) (1) | [NOK] MCU executes unknown instructions and will most likely end up in an infinite loop or freeze in an error handler. The bootloader does not run, it can do nothing, the MCU is stucked until next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset.
New firmware runs, does not set the valid bit and does not refresh the watchdog | [NOK] The new firmware runs until the next reset. The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset. New firmware runs, does not set the valid bit and does not refresh the watchdog | [NOK] The new firmware runs until the next reset. The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset.
New firmware does not run properly, does not set the valid bit but refreshes the watchdog | [NOK] The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged and will be able to rollback to the previous version. New firmware does not run properly, does not set the valid bit but refreshes the watchdog | [NOK] The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged and will be able to rollback to the previous version.
New firmware does not run properly but sets the valid bit and refreshes the watchdog | [NOK] The bootloader won't revert to the previous version because the valid flag is set | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged. Then, the bootloader must provide a way for the user to force the rollback to the previous version New firmware does not run properly but sets the valid bit and refreshes the watchdog | [NOK] The bootloader won't revert to the previous version because the valid flag is set | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged. Then, the bootloader must provide a way for the user to force the rollback to the previous version

View File

@ -1 +0,0 @@
__pycache__

View File

@ -236,7 +236,7 @@ class BleDfuControllerSecure(NrfBleDfuController):
self._dfu_send_command(Procedures.EXECUTE) self._dfu_send_command(Procedures.EXECUTE)
self._wait_and_parse_notify() self._wait_and_parse_notify()
print("Init packet successfully transferred") print("Init packet successfully transfered")
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Send the Firmware image to peripheral device. # Send the Firmware image to peripheral device.
@ -319,5 +319,5 @@ class BleDfuControllerSecure(NrfBleDfuController):
self._dfu_send_command(Procedures.EXECUTE) self._dfu_send_command(Procedures.EXECUTE)
self._wait_and_parse_notify() self._wait_and_parse_notify()
# If everything executed correctly, return amount of bytes transferred # If everything executed correctly, return amount of bytes transfered
return obj_max_size return obj_max_size

View File

@ -106,6 +106,7 @@ macro(nRF5x_setup)
${NRF5_SDK_PATH}/external/freertos/source/stream_buffer.c ${NRF5_SDK_PATH}/external/freertos/source/stream_buffer.c
${NRF5_SDK_PATH}/external/freertos/source/tasks.c ${NRF5_SDK_PATH}/external/freertos/source/tasks.c
${NRF5_SDK_PATH}/external/freertos/source/timers.c ${NRF5_SDK_PATH}/external/freertos/source/timers.c
${NRF5_SDK_PATH}/components/libraries/timer/app_timer_freertos.c
) )
# freertos include # freertos include
@ -334,6 +335,7 @@ endmacro(nRF5x_addAppFIFO)
# adds app-level Timer libraries # adds app-level Timer libraries
macro(nRF5x_addAppTimer) macro(nRF5x_addAppTimer)
list(APPEND SDK_SOURCE_FILES list(APPEND SDK_SOURCE_FILES
"${NRF5_SDK_PATH}/components/libraries/timer/app_timer.c"
) )
endmacro(nRF5x_addAppTimer) endmacro(nRF5x_addAppTimer)

View File

@ -7,7 +7,7 @@ Cmake script for projects targeting Nordic Semiconductor nRF5x series devices us
The script makes use of the following tools: The script makes use of the following tools:
- nRF5x SDK by Nordic Semiconductor - SoC specific drivers and libraries (also includes a lot of examples) - nRF5x SDK by Nordic Semiconductor - SoC specific drivers and libraries (also includes a lot of examples)
- JLink by Segger - interface software for the JLink family of programmers - JLink by Segger - interface software for the JLink familiy of programmers
- nrfjprog by Nordic Semiconductor - Wrapper utility around JLink - nrfjprog by Nordic Semiconductor - Wrapper utility around JLink
- arm-non-eabi-gcc by ARM and the GCC Team - compiler toolchain for embedded (= bare metal) ARM chips - arm-non-eabi-gcc by ARM and the GCC Team - compiler toolchain for embedded (= bare metal) ARM chips
@ -15,11 +15,11 @@ The script makes use of the following tools:
1. Download this repo (or add as submodule) to the directory `cmake-nRF5x` in your project 1. Download this repo (or add as submodule) to the directory `cmake-nRF5x` in your project
1. Search the SDK `example` directory for a `sdk_config.h`, `main.c` and a linker script (normally named `<project_name>_gcc_<chip family>.ld`) that fits your chip and project needs. 1. Search the SDK `example` directory for a `sdk_config.h`, `main.c` and a linker script (normally named `<project_name>_gcc_<chip familly>.ld`) that fits your chip and project needs.
1. Copy the `sdk_config.h` and the project `main.c` into a new directory `src`. Modify them as required for your project. 1. Copy the `sdk_config.h` and the project `main.c` into a new directory `src`. Modify them as required for your project.
1. Copy the linker script into the root of your project. Rename it to just `gcc_<chip family>.ld` For example: 1. Copy the linker script into the root of your project. Rename it to just `gcc_<chip familly>.ld` For example:
``` ```
gcc_nrf51.ld gcc_nrf51.ld

View File

@ -51,16 +51,16 @@ Puncover is really easy to install:
- `python -m virtualenv venv` - `python -m virtualenv venv`
- `source venv/bin/activate` - `source venv/bin/activate`
- Install : `pip install .` - Install : `pip install .`
- Run : `puncover --gcc_tools_base=/path/to/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin/arm-none-eabi- --elf_file /path/to/build/directory/src/pinetime-app-1.1.0.out --src_root /path/to/sources --build_dir /path/to/build/directory` - Run : `puncover --gcc_tools_base=/path/to/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi- --elf_file /path/to/build/directory/src/pinetime-app-1.1.0.out --src_root /path/to/sources --build_dir /path/to/build/directory`
- Replace - Replace
* `/path/to/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin` with the path to your gcc-arm-none-eabi toolchain * `/path/to/gcc-arm-none-eabi-9-2020-q2-update/bin` with the path to your gcc-arm-none-eabi toolchain
* `/path/to/build/directory/src/pinetime-app-1.1.0.out` with the path to the binary generated by GCC (.out file) * `/path/to/build/directory/src/pinetime-app-1.1.0.out` with the path to the binary generated by GCC (.out file)
* `/path/to/sources` with the path to the root folder of the sources (checkout directory) * `/path/to/sources` with the path to the root folder of the sources (checkout directory)
* `/path/to/build/directory` with the path to the build directory * `/path/to/build/directory` with the path to the build directory
- Launch a browser at http://localhost:5000/ - Launch a browser at http://localhost:5000/
### Analysis ### Analysis
Using the MAP file and tools, we can easily see what symbols are using most of the flash memory. In this case, unsurprisingly, fonts and graphics are the largest use of flash memory. Using the MAP file and tools, we can easily see what symbols are using most of the flash memory. In this case, unsuprisingly, fonts and graphics are the largest use of flash memory.
![Puncover](./memoryAnalysis/puncover-all-symbols.png) ![Puncover](./memoryAnalysis/puncover-all-symbols.png)
@ -150,7 +150,7 @@ You can then display the file using objdump:
hexdump ram.bin -v | less hexdump ram.bin -v | less
``` ```
The stack is positioned at the end of the RAM -> 0xFFFF. Its size is 8192 bytes, so the end of the stack is at 0xE000. The stack is positionned at the end of the RAM -> 0xFFFF. Its size is 8192 bytes, so the end of the stack is at 0xE000.
On the following dump, the maximum stack usage is 520 bytes (0xFFFF - 0xFDF8): On the following dump, the maximum stack usage is 520 bytes (0xFFFF - 0xFDF8):
``` ```

View File

@ -13,7 +13,7 @@ The service UUID is 00010000-78fc-48fe-8e23-433b3a1942d0
## Characteristics ## Characteristics
## Flags (UUID 00010001-78fc-48fe-8e23-433b3a1942d0) ## Flags (UUID 00010001-78fc-48fe-8e23-433b3a1942d0)
All included icons are from pure-maps, which provides the actual routing from the client. The icon names ultimately come from the mapbox project "direction-icons", See https://github.com/rinigus/pure-maps/tree/master/qml/icons/navigation See the end of this document for the full list of supported icon names. All included icons are from pure-maps, which provides the actual routing from the client. The icon names ultimately come from the mapbox project "direction-icons", See https://github.com/rinigus/pure-maps/tree/master/qml/icons/navigation See the end of this document for the full lsit of supported icon names.
## Narrative (UUID 00010002-78fc-48fe-8e23-433b3a1942d0) ## Narrative (UUID 00010002-78fc-48fe-8e23-433b3a1942d0)
This is a client supplied string describing the upcoming instruction such as "At the roundabout take the first exit". This is a client supplied string describing the upcoming instruction such as "At the roundabout take the first exit".

View File

@ -1,5 +1,5 @@
# Build a stub for PineTime using NRF52-DK # Build a stub for PineTime using NRF52-DK
[NRF52-DK](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52-DK) is the official development kit for the NRF52832 SoC from Nordic Semiconductor used in the PineTime. [NRF52-DK](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52-DK) is the official developpment kit for the NRF52832 SoC from Nordic Semiconductor used in the PineTime.
This development kit can be very useful for PineTime development: This development kit can be very useful for PineTime development:
* You can use its embedded JLink SWD programmer/debugger to program and debug your code on the PineTime * You can use its embedded JLink SWD programmer/debugger to program and debug your code on the PineTime

View File

@ -1,7 +1,7 @@
# How to flash InfiniTime using the SWD interface # How to flash InfiniTime using the SWD interface
Download the files **bootloader.bin**, **image-x.y.z.bin** and **pinetime-graphics-x.y.z.bin** from the release page: Download the files **bootloader.bin**, **image-x.y.z.bin** and **pinetime-graphics-x.y.z.bin** from the release page:
![Image file](gettingStarted/imageFile.png) ![Image file](imageFile.png)
The bootloader reads a boot logo from the external SPI flash memory. The first step consists of flashing a tool in the MCU that will flash the boot logo into this SPI flash memory. This first step is optional but recommended (the bootloader will display garbage on screen for a few second if you don't do it). The bootloader reads a boot logo from the external SPI flash memory. The first step consists of flashing a tool in the MCU that will flash the boot logo into this SPI flash memory. This first step is optional but recommended (the bootloader will display garbage on screen for a few second if you don't do it).
Using your SWD tool, flash **pinetime-graphics-x.y.z.bin** at offset **0x0000**. Reset the MCU and wait for a few seconds until the logo is completely drawn on the display. Using your SWD tool, flash **pinetime-graphics-x.y.z.bin** at offset **0x0000**. Reset the MCU and wait for a few seconds until the logo is completely drawn on the display.

View File

@ -146,14 +146,14 @@ The new alert characteristic allows sending new notifications to InfiniTime. It
For example, here is what a normal notification looks like in Golang (language of `itd`): For example, here is what a normal notification looks like in Golang (language of `itd`):
```go ```go
// \x00 is the category for simple alert, and there is one new notification, hence \x01. // \x00 is the category for simple alert, and there is one new notifcation, hence \x01.
"\x00\x01\x00Test Title\x00Test Body" "\x00\x01\x00Test Title\x00Test Body"
``` ```
A call notification looks like so: A call notification looks like so:
```go ```go
// \x03 is the category for calls, and there is one new call notification, hence \x01. // \x03 is the category for calls, and there is one new call notifcation, hence \x01.
"\x03\x01\x00Mary" "\x03\x01\x00Mary"
``` ```

View File

@ -3,7 +3,7 @@ Pinetime --> CompanionApp: Start advertising
group BLE Connection group BLE Connection
CompanionApp -> Pinetime: Connection request CompanionApp -> Pinetime: Connection request
CompanionApp <-> Pinetime: Connection parameters negotiation, security procedure,... CompanionApp <-> Pinetime: Connection parameters negociation, security procedure,...
end end
group Service Discovery group Service Discovery

View File

@ -5,7 +5,7 @@ The project is based on 2 main branches:
- **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. - **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.
- **develop** : this branch contains the latest development that will be integrated in the next release once it's considered as stable. - **develop** : this branch contains the latest development that will be integrated in the next release once it's considered as stable.
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. 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 succesfully reviewed and accepted.
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**. 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**.

View File

@ -1,7 +1,7 @@
# Build # Build
## Dependencies ## Dependencies
To build this project, you'll need: To build this project, you'll need:
- A cross-compiler : [ARM-GCC (arm-none-eabi 11.2-2022.02)](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads) - 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)
- 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) - 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)
- The Python 3 modules `cbor`, `intelhex`, `click` and `cryptography` modules for the `mcuboot` tool (see [requirements.txt](../tools/mcuboot/requirements.txt)) - The Python 3 modules `cbor`, `intelhex`, `click` and `cryptography` modules for the `mcuboot` tool (see [requirements.txt](../tools/mcuboot/requirements.txt))
- To keep the system clean, you can install python modules into a python virtual environment (`venv`) - To keep the system clean, you can install python modules into a python virtual environment (`venv`)
@ -12,10 +12,6 @@ To build this project, you'll need:
python -m pip install -r tools/mcuboot/requirements.txt python -m pip install -r tools/mcuboot/requirements.txt
``` ```
- A reasonably recent version of CMake (I use 3.16.5) - A reasonably recent version of CMake (I use 3.16.5)
- lv_font_conv, to generate the font .c files
- see [lv_font_conv](https://github.com/lvgl/lv_font_conv#install-the-script)
- install npm (commonly done via the package manager, ensure node's version is at least 12)
- install lv_font_conv: `npm install lv_font_conv`
## Build steps ## Build steps
### Clone the repo ### Clone the repo
@ -31,7 +27,7 @@ CMake configures the project according to variables you specify the command line
Variable | Description | Example| Variable | Description | Example|
----------|-------------|--------| ----------|-------------|--------|
**ARM_NONE_EABI_TOOLCHAIN_PATH**|path to the toolchain directory|`-DARM_NONE_EABI_TOOLCHAIN_PATH=/home/jf/nrf52/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/`| **ARM_NONE_EABI_TOOLCHAIN_PATH**|path to the toolchain directory|`-DARM_NONE_EABI_TOOLCHAIN_PATH=/home/jf/nrf52/gcc-arm-none-eabi-9-2020-q2-update/`|
**NRF5_SDK_PATH**|path to the NRF52 SDK|`-DNRF5_SDK_PATH=/home/jf/nrf52/Pinetime/sdk`| **NRF5_SDK_PATH**|path to the NRF52 SDK|`-DNRF5_SDK_PATH=/home/jf/nrf52/Pinetime/sdk`|
**USE_JLINK, USE_GDB_CLIENT and USE_OPENOCD**|Enable *JLink* mode, *GDB Client* (Black Magic Probe) mode or *OpenOCD* mode (set the one you want to use to `1`)|`-DUSE_JLINK=1` **USE_JLINK, USE_GDB_CLIENT and USE_OPENOCD**|Enable *JLink* mode, *GDB Client* (Black Magic Probe) mode or *OpenOCD* mode (set the one you want to use to `1`)|`-DUSE_JLINK=1`
**CMAKE_BUILD_TYPE (\*)**| Build type (Release or Debug). Release is applied by default if this variable is not specified.|`-DCMAKE_BUILD_TYPE=Debug` **CMAKE_BUILD_TYPE (\*)**| Build type (Release or Debug). Release is applied by default if this variable is not specified.|`-DCMAKE_BUILD_TYPE=Debug`
@ -47,7 +43,7 @@ By default, this variable is set to *Release*. It compiles the code with size an
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. 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**: ####(**) Note about **BUILD_DFU**:
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. 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.
#### CMake command line for JLink #### CMake command line for JLink
``` ```

View File

@ -1,58 +1,62 @@
# Build the project using Docker # Build the project using Docker
A [Docker image (Dockerfile)](../docker) containing all the build environment is available for X86_64 and AMD64 architectures. A [Docker image (Dockerfile)](../docker) containing all the build environment is available for X86_64 and AMD64 architectures. These images make the build of the firmware and the generation of the DFU file for OTA quite easy, as well as preventing clashes with any other toolchains or development environments you may have installed.
These images make the build of the firmware and the generation of the DFU file for OTA quite easy, as well as preventing clashes with any other toolchains or development environments you may have installed.
Based on Ubuntu 22.04 with the following build dependencies: Based on Ubuntu 18.04 with the following build dependencies:
* ARM GCC Toolchain * ARM GCC Toolchain
* nRF SDK * nRF SDK
* MCUBoot * MCUBoot
* adafruit-nrfutil * adafruit-nrfutil
* lv_font_conv
## Run a container to build the project ## Run a container to build the project
The `infinitime-build` image contains all the dependencies you need. 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 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. 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. 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**:
For cloning the repo, see [these instructions](../doc/buildAndProgram.md#clone-the-repo). Outputs will be written to **<project_root>/build/output**:
```bash ```bash
cd <project_root> # e.g. cd ./work/Pinetime cd <project_root> # e.g. cd ./work/Pinetime
docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime-build docker run --rm -it -v $(pwd):/sources infinitime-build
``` ```
By default, the container runs as `root`, which is not convenient as all the files generated by the build will also belong to `root`. If you only want to build a single CMake target, you can pass it in as the first parameter to the build script. This means calling the script explicitly as it will override the `CMD`. Here's an example For `pinetime-app`:
The parameter `--user` overrides that default behavior.
The command above will run as your current user.
If you only want to build a single CMake target, you can pass it in as the first parameter to the build script.
This means calling the script explicitly as it will override the `CMD`.
Here's an example for `pinetime-app`:
```bash ```bash
docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime-build /opt/build.sh pinetime-app docker run --rm -it -v $(pwd):/sources infinitime-build /opt/build.sh pinetime-app
```
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`:
```bash
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:
```bash
docker run --rm -it -v $(pwd):/sources --user 1234:1234 infinitime-build
``` ```
## Using the image from Docker Hub ## Using the image from Docker Hub
The image is available via Docker Hub for both the amd64 and arm64v8 architectures at [infinitime/infinitime-build](https://hub.docker.com/repository/docker/infinitime/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).
You can run it using the following command: It can be pulled (downloaded) using the following command:
```bash ```bash
docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinitime/infinitime-build docker pull pfeerick/infinitime-build
``` ```
The default `latest` tag *should* automatically identify the correct image architecture, but if for some reason Docker does not, you can specify it manually: The default `latest` tag *should* automatically identify the correct image architecture, but if for some reason Docker does not, you can specify it manually:
* For AMD64 (x86_64) systems: `docker pull --platform linux/amd64 infinitime/infinitime-build` * For AMD64 (x86_64) systems: `docker pull pfeerick/infinitime-build:amd64`
* For ARM64v8 (ARM64/aarch64) systems: `docker pull --platform linux/arm64 infinitime/infinitime-build` * For ARM64v8 (ARM64/aarch64) systems: `docker pull pfeerick/infinitime-build:arm64v8`
## Build the image ## Build the image
@ -61,5 +65,11 @@ You can build the image yourself if you like!
The following commands must be run from the root of the project. This operation will take some time but, when done, a new image named *infinitime-build* is available. The following commands must be run from the root of the project. This operation will take some time but, when done, a new image named *infinitime-build* is available.
```bash ```bash
docker build -t infinitime-build ./docker docker image build -t infinitime-build ./docker
```
The `PUID` and `PGID` build arguments are used to set the user and group ids used in the container, meaning you will not need to specify it later unless they change for some reason. Specifying them is not mandatory, as this can be over-ridden at build time via the `--user` flag, but doing so will make the command you need to run later a bit shorter. In the below examples, they are set to your current user id and group id automatically. You can specify them manually, but they must be specified by number, not by name.
```bash
docker image build -t infinitime-build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) ./docker
``` ```

View File

@ -8,7 +8,7 @@ To support as many setups as possible the VS Code configuration files expect the
Variable | Description | Example Variable | Description | Example
----------|-------------|-------- ----------|-------------|--------
**ARM_NONE_EABI_TOOLCHAIN_PATH**|path to the toolchain directory|`export ARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi` **ARM_NONE_EABI_TOOLCHAIN_PATH**|path to the toolchain directory|`export ARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update`
**NRF5_SDK_PATH**|path to the NRF52 SDK|`export NRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345` **NRF5_SDK_PATH**|path to the NRF52 SDK|`export NRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345`
## VS Code Extensions ## VS Code Extensions

View File

@ -18,7 +18,7 @@ You can sync the time using companion apps.
You can also set the time in the settings without a companion app. (version >1.7.0) You can also set the time in the settings without a companion app. (version >1.7.0)
InfiniTime doesn't handle daylight savings automatically, so make sure to set the correct time or sync it with a companion app. InfiniTime doesn't handle daylight savings automatically, so make sure to set the correct the time or sync it with a companion app.
### Digital watch face ### Digital watch face

View File

@ -9,6 +9,5 @@
- Top bar takes at least 20px + padding - Top bar takes at least 20px + padding
- Top bar right icons move 8px to the left when using a page indicator - Top bar right icons move 8px to the left when using a page indicator
- A black background helps to hide the screen border, allowing the UI to look less cramped when utilizing the entire display area. - A black background helps to hide the screen border, allowing the UI to look less cramped when utilizing the entire display area.
- A switch should be twice as wide as it is tall.
![example layouts](./ui/example.png) ![example layouts](./ui/example.png)

View File

@ -1,4 +1,4 @@
FROM ubuntu:22.04 FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \ RUN apt-get update -qq \
@ -11,27 +11,21 @@ RUN apt-get update -qq \
make \ make \
python3 \ python3 \
python3-pip \ python3-pip \
python-is-python3 \
tar \ tar \
unzip \ unzip \
wget \ wget \
curl \
# aarch64 packages # aarch64 packages
libffi-dev \ libffi-dev \
libssl-dev \ libssl-dev \
python3-dev \ python3-dev \
python \
git \ git \
apt-utils \
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/*; && rm -rf /var/cache/apt/* /var/lib/apt/lists/*;
# Git needed for PROJECT_GIT_COMMIT_HASH variable setting # Git needed for PROJECT_GIT_COMMIT_HASH variable setting
RUN pip3 install adafruit-nrfutil RUN pip3 install adafruit-nrfutil
RUN pip3 install -Iv cryptography==3.3 RUN pip3 install -Iv cryptography==3.3
RUN pip3 install cbor
RUN npm i lv_font_conv@1.5.2 -g
# build.sh knows how to compile # build.sh knows how to compile
COPY build.sh /opt/ COPY build.sh /opt/
@ -44,5 +38,10 @@ RUN bash -c "source /opt/build.sh; GetNrfSdk;"
# McuBoot # McuBoot
RUN bash -c "source /opt/build.sh; GetMcuBoot;" RUN bash -c "source /opt/build.sh; GetMcuBoot;"
ARG PUID=1000
ARG PGID=1000
RUN groupadd --system --gid $PGID infinitime && useradd --system --uid $PUID --gid $PGID infinitime
USER infinitime:infinitime
ENV SOURCES_DIR /sources ENV SOURCES_DIR /sources
CMD ["/opt/build.sh"] CMD ["/opt/build.sh"]

View File

@ -9,23 +9,21 @@ set -e
export TOOLS_DIR="${TOOLS_DIR:=/opt}" export TOOLS_DIR="${TOOLS_DIR:=/opt}"
export SOURCES_DIR="${SOURCES_DIR:=/sources}" export SOURCES_DIR="${SOURCES_DIR:=/sources}"
export BUILD_DIR="${BUILD_DIR:=$SOURCES_DIR/build}" export BUILD_DIR="${BUILD_DIR:=$SOURCES_DIR/build}"
export OUTPUT_DIR="${OUTPUT_DIR:=$SOURCES_DIR/build/output}" export OUTPUT_DIR="${OUTPUT_DIR:=$BUILD_DIR/output}"
export BUILD_TYPE=${BUILD_TYPE:=Release} export BUILD_TYPE=${BUILD_TYPE:=Release}
export GCC_ARM_VER=${GCC_ARM_VER:="11.2-2022.02"} export GCC_ARM_VER=${GCC_ARM_VER:="gcc-arm-none-eabi-9-2020-q2-update"}
export NRF_SDK_VER=${NRF_SDK_VER:="nRF5_SDK_15.3.0_59ac345"} export NRF_SDK_VER=${NRF_SDK_VER:="nRF5_SDK_15.3.0_59ac345"}
MACHINE="$(uname -m)" MACHINE="$(uname -m)"
[[ "$MACHINE" == "arm64" ]] && MACHINE="aarch64" [[ "$MACHINE" == "arm64" ]] && MACHINE="aarch64"
export GCC_ARM_PATH="gcc-arm-$GCC_ARM_VER-$MACHINE-arm-none-eabi"
main() { main() {
local target="$1" local target="$1"
mkdir -p "$TOOLS_DIR" mkdir -p "$TOOLS_DIR"
[[ ! -d "$TOOLS_DIR/$GCC_ARM_PATH" ]] && GetGcc [[ ! -d "$TOOLS_DIR/$GCC_ARM_VER" ]] && GetGcc
[[ ! -d "$TOOLS_DIR/$NRF_SDK_VER" ]] && GetNrfSdk [[ ! -d "$TOOLS_DIR/$NRF_SDK_VER" ]] && GetNrfSdk
[[ ! -d "$TOOLS_DIR/mcuboot" ]] && GetMcuBoot [[ ! -d "$TOOLS_DIR/mcuboot" ]] && GetMcuBoot
@ -40,7 +38,8 @@ main() {
} }
GetGcc() { GetGcc() {
wget -q https://developer.arm.com/-/media/Files/downloads/gnu/$GCC_ARM_VER/binrel/$GCC_ARM_PATH.tar.xz -O - | tar -xJ -C $TOOLS_DIR/ GCC_SRC="$GCC_ARM_VER-$MACHINE-linux.tar.bz"
wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/$GCC_SRC -O - | tar -xj -C $TOOLS_DIR/
} }
GetMcuBoot() { GetMcuBoot() {
@ -55,14 +54,18 @@ GetNrfSdk() {
} }
CmakeGenerate() { CmakeGenerate() {
# We can swap the CD and trailing SOURCES_DIR for -B and -S respectively
# once we go to newer CMake (Ubuntu 18.10 gives us CMake 3.10)
cd "$BUILD_DIR"
cmake -G "Unix Makefiles" \ cmake -G "Unix Makefiles" \
-S "$SOURCES_DIR" \
-B "$BUILD_DIR" \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DUSE_OPENOCD=1 \ -DUSE_OPENOCD=1 \
-DARM_NONE_EABI_TOOLCHAIN_PATH="$TOOLS_DIR/$GCC_ARM_PATH" \ -DARM_NONE_EABI_TOOLCHAIN_PATH="$TOOLS_DIR/$GCC_ARM_VER" \
-DNRF5_SDK_PATH="$TOOLS_DIR/$NRF_SDK_VER" \ -DNRF5_SDK_PATH="$TOOLS_DIR/$NRF_SDK_VER" \
-DBUILD_DFU=1 -DBUILD_DFU=1 \
"$SOURCES_DIR"
cmake -L -N .
} }
CmakeBuild() { CmakeBuild() {

View File

@ -15,10 +15,12 @@ cp "$BUILD_DIR/src/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/p
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin"
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip"
mkdir -p "$OUTPUT_DIR/src" mkdir -p "$OUTPUT_DIR/src"
cp $BUILD_DIR/src/*.bin "$OUTPUT_DIR/src/" cd "$BUILD_DIR"
cp $BUILD_DIR/src/*.hex "$OUTPUT_DIR/src/" cp src/*.bin "$OUTPUT_DIR/src"
cp $BUILD_DIR/src/*.out "$OUTPUT_DIR/src/" cp src/*.hex "$OUTPUT_DIR/src"
cp $BUILD_DIR/src/*.map "$OUTPUT_DIR/src/" cp src/*.out "$OUTPUT_DIR/src"
cp src/*.map "$OUTPUT_DIR/src"
ls -RUv1 "$OUTPUT_DIR" | sed 's;^\([^/]\); \1;g' ls -RUv1 "$OUTPUT_DIR" | sed 's;^\([^/]\); \1;g'

View File

@ -13659,12 +13659,12 @@ POSSIBILITY OF SUCH DAMAGE.\n
<usage>read</usage> <usage>read</usage>
<enumeratedValue> <enumeratedValue>
<name>NotPresent</name> <name>NotPresent</name>
<description>Read: no overrun occurred</description> <description>Read: no overrun occured</description>
<value>0</value> <value>0</value>
</enumeratedValue> </enumeratedValue>
<enumeratedValue> <enumeratedValue>
<name>Present</name> <name>Present</name>
<description>Read: overrun occurred</description> <description>Read: overrun occured</description>
<value>1</value> <value>1</value>
</enumeratedValue> </enumeratedValue>
</enumeratedValues> </enumeratedValues>

View File

@ -31,10 +31,6 @@ const bool BootloaderVersion::IsValid() {
void BootloaderVersion::SetVersion(uint32_t v) { void BootloaderVersion::SetVersion(uint32_t v) {
BootloaderVersion::version = v; BootloaderVersion::version = v;
snprintf(BootloaderVersion::versionString, snprintf(BootloaderVersion::versionString, BootloaderVersion::VERSION_STR_LEN, "%ld.%ld.%ld",
BootloaderVersion::VERSION_STR_LEN, BootloaderVersion::Major(), BootloaderVersion::Minor(), BootloaderVersion::Patch());
"%ld.%ld.%ld",
BootloaderVersion::Major(),
BootloaderVersion::Minor(),
BootloaderVersion::Patch());
} }

View File

@ -12,7 +12,6 @@ namespace Pinetime {
static const char* VersionString(); static const char* VersionString();
static const bool IsValid(); static const bool IsValid();
static void SetVersion(uint32_t v); static void SetVersion(uint32_t v);
private: private:
static uint32_t version; static uint32_t version;
static constexpr size_t VERSION_STR_LEN = 12; static constexpr size_t VERSION_STR_LEN = 12;

View File

@ -42,6 +42,7 @@ set(SDK_SOURCE_FILES
"${NRF5_SDK_PATH}/modules/nrfx/drivers/src/nrfx_gpiote.c" "${NRF5_SDK_PATH}/modules/nrfx/drivers/src/nrfx_gpiote.c"
"${NRF5_SDK_PATH}/modules/nrfx/soc/nrfx_atomic.c" "${NRF5_SDK_PATH}/modules/nrfx/soc/nrfx_atomic.c"
"${NRF5_SDK_PATH}/modules/nrfx/drivers/src/nrfx_saadc.c" "${NRF5_SDK_PATH}/modules/nrfx/drivers/src/nrfx_saadc.c"
"${NRF5_SDK_PATH}/components/libraries/timer/app_timer.h"
# FreeRTOS # FreeRTOS
${NRF5_SDK_PATH}/external/freertos/source/croutine.c ${NRF5_SDK_PATH}/external/freertos/source/croutine.c
@ -52,6 +53,7 @@ set(SDK_SOURCE_FILES
${NRF5_SDK_PATH}/external/freertos/source/stream_buffer.c ${NRF5_SDK_PATH}/external/freertos/source/stream_buffer.c
${NRF5_SDK_PATH}/external/freertos/source/tasks.c ${NRF5_SDK_PATH}/external/freertos/source/tasks.c
${NRF5_SDK_PATH}/external/freertos/source/timers.c ${NRF5_SDK_PATH}/external/freertos/source/timers.c
${NRF5_SDK_PATH}/components/libraries/timer/app_timer_freertos.c
# Libs # Libs
"${NRF5_SDK_PATH}/components/libraries/atomic/nrf_atomic.c" "${NRF5_SDK_PATH}/components/libraries/atomic/nrf_atomic.c"
@ -365,8 +367,36 @@ set(QCBOR_SRC
) )
list(APPEND IMAGE_FILES list(APPEND IMAGE_FILES
displayapp/icons/battery/batteryicon.c displayapp/icons/battery/os_battery_error.c
displayapp/icons/battery/os_battery_100.c
displayapp/icons/battery/os_battery_090.c
displayapp/icons/battery/os_battery_080.c
displayapp/icons/battery/os_battery_070.c
displayapp/icons/battery/os_battery_060.c
displayapp/icons/battery/os_battery_050.c
displayapp/icons/battery/os_battery_040.c
displayapp/icons/battery/os_battery_030.c
displayapp/icons/battery/os_battery_020.c
displayapp/icons/battery/os_battery_010.c
displayapp/icons/battery/os_battery_005.c
displayapp/icons/battery/os_batterycharging_100.c
displayapp/icons/battery/os_batterycharging_090.c
displayapp/icons/battery/os_batterycharging_080.c
displayapp/icons/battery/os_batterycharging_070.c
displayapp/icons/battery/os_batterycharging_060.c
displayapp/icons/battery/os_batterycharging_050.c
displayapp/icons/battery/os_batterycharging_040.c
displayapp/icons/battery/os_batterycharging_030.c
displayapp/icons/battery/os_batterycharging_020.c
displayapp/icons/battery/os_batterycharging_010.c
displayapp/icons/battery/os_batterycharging_005.c
displayapp/icons/bluetooth/os_bt_connected.c
displayapp/icons/bluetooth/os_bt_disconnected.c
) )
list(APPEND SOURCE_FILES list(APPEND SOURCE_FILES
BootloaderVersion.cpp BootloaderVersion.cpp
logging/NrfLogger.cpp logging/NrfLogger.cpp
@ -374,12 +404,14 @@ list(APPEND SOURCE_FILES
displayapp/screens/Screen.cpp displayapp/screens/Screen.cpp
displayapp/screens/Clock.cpp displayapp/screens/Clock.cpp
displayapp/screens/Tile.cpp displayapp/screens/Tile.cpp
displayapp/screens/Meter.cpp
displayapp/screens/InfiniPaint.cpp displayapp/screens/InfiniPaint.cpp
displayapp/screens/Paddle.cpp displayapp/screens/Paddle.cpp
displayapp/screens/StopWatch.cpp displayapp/screens/StopWatch.cpp
displayapp/screens/BatteryIcon.cpp displayapp/screens/BatteryIcon.cpp
displayapp/screens/BleIcon.cpp displayapp/screens/BleIcon.cpp
displayapp/screens/NotificationIcon.cpp displayapp/screens/NotificationIcon.cpp
displayapp/screens/Brightness.cpp
displayapp/screens/SystemInfo.cpp displayapp/screens/SystemInfo.cpp
displayapp/screens/Label.cpp displayapp/screens/Label.cpp
displayapp/screens/FirmwareUpdate.cpp displayapp/screens/FirmwareUpdate.cpp
@ -403,9 +435,7 @@ list(APPEND SOURCE_FILES
displayapp/screens/Error.cpp displayapp/screens/Error.cpp
displayapp/screens/Alarm.cpp displayapp/screens/Alarm.cpp
displayapp/screens/Styles.cpp displayapp/screens/Styles.cpp
displayapp/screens/Agenda.cpp
displayapp/Colors.cpp displayapp/Colors.cpp
displayapp/widgets/Counter.cpp
## Settings ## Settings
displayapp/screens/settings/QuickSettings.cpp displayapp/screens/settings/QuickSettings.cpp
@ -417,16 +447,12 @@ list(APPEND SOURCE_FILES
displayapp/screens/settings/SettingSteps.cpp displayapp/screens/settings/SettingSteps.cpp
displayapp/screens/settings/SettingSetDate.cpp displayapp/screens/settings/SettingSetDate.cpp
displayapp/screens/settings/SettingSetTime.cpp displayapp/screens/settings/SettingSetTime.cpp
displayapp/screens/settings/SettingChimes.cpp
displayapp/screens/settings/SettingShakeThreshold.cpp
displayapp/screens/settings/SettingBluetooth.cpp
## Watch faces ## Watch faces
displayapp/icons/bg_clock.c displayapp/icons/bg_clock.c
displayapp/screens/WatchFaceAnalog.cpp displayapp/screens/WatchFaceAnalog.cpp
displayapp/screens/WatchFaceDigital.cpp displayapp/screens/WatchFaceDigital.cpp
displayapp/screens/WatchFaceTerminal.cpp displayapp/screens/PineTimeStyle.cpp
displayapp/screens/WatchFacePineTimeStyle.cpp
## ##
@ -458,7 +484,7 @@ list(APPEND SOURCE_FILES
components/ble/MusicService.cpp components/ble/MusicService.cpp
components/ble/weather/WeatherService.cpp components/ble/weather/WeatherService.cpp
components/ble/NavigationService.cpp components/ble/NavigationService.cpp
components/ble/AgendaService.cpp displayapp/fonts/lv_font_navi_80.c
components/ble/BatteryInformationService.cpp components/ble/BatteryInformationService.cpp
components/ble/FSService.cpp components/ble/FSService.cpp
components/ble/ImmediateAlertService.cpp components/ble/ImmediateAlertService.cpp
@ -477,10 +503,15 @@ list(APPEND SOURCE_FILES
FreeRTOS/port_cmsis.c FreeRTOS/port_cmsis.c
displayapp/LittleVgl.cpp displayapp/LittleVgl.cpp
displayapp/fonts/jetbrains_mono_extrabold_compressed.c
displayapp/fonts/jetbrains_mono_bold_20.c
displayapp/fonts/jetbrains_mono_76.c
displayapp/fonts/jetbrains_mono_42.c
displayapp/fonts/lv_font_sys_48.c
displayapp/fonts/open_sans_light.c
displayapp/lv_pinetime_theme.c displayapp/lv_pinetime_theme.c
systemtask/SystemTask.cpp systemtask/SystemTask.cpp
systemtask/SystemMonitor.cpp
drivers/TwiMaster.cpp drivers/TwiMaster.cpp
heartratetask/HeartRateTask.cpp heartratetask/HeartRateTask.cpp
@ -530,7 +561,6 @@ list(APPEND RECOVERY_SOURCE_FILES
components/ble/ImmediateAlertService.cpp components/ble/ImmediateAlertService.cpp
components/ble/ServiceDiscovery.cpp components/ble/ServiceDiscovery.cpp
components/ble/NavigationService.cpp components/ble/NavigationService.cpp
components/ble/AgendaService.cpp
components/ble/HeartRateService.cpp components/ble/HeartRateService.cpp
components/ble/MotionService.cpp components/ble/MotionService.cpp
components/firmwarevalidator/FirmwareValidator.cpp components/firmwarevalidator/FirmwareValidator.cpp
@ -543,7 +573,6 @@ list(APPEND RECOVERY_SOURCE_FILES
FreeRTOS/port_cmsis.c FreeRTOS/port_cmsis.c
systemtask/SystemTask.cpp systemtask/SystemTask.cpp
systemtask/SystemMonitor.cpp
drivers/TwiMaster.cpp drivers/TwiMaster.cpp
components/gfx/Gfx.cpp components/gfx/Gfx.cpp
components/rle/RleDecoder.cpp components/rle/RleDecoder.cpp
@ -581,7 +610,6 @@ list(APPEND RECOVERYLOADER_SOURCE_FILES
set(INCLUDE_FILES set(INCLUDE_FILES
${CMAKE_CURRENT_BINARY_DIR}/src/Version.h
BootloaderVersion.h BootloaderVersion.h
logging/Logger.h logging/Logger.h
logging/NrfLogger.h logging/NrfLogger.h
@ -591,12 +619,15 @@ set(INCLUDE_FILES
displayapp/screens/Screen.h displayapp/screens/Screen.h
displayapp/screens/Clock.h displayapp/screens/Clock.h
displayapp/screens/Tile.h displayapp/screens/Tile.h
displayapp/screens/Meter.h
displayapp/screens/InfiniPaint.h displayapp/screens/InfiniPaint.h
displayapp/screens/StopWatch.h displayapp/screens/StopWatch.h
displayapp/screens/Paddle.h displayapp/screens/Paddle.h
displayapp/screens/DropDownDemo.h
displayapp/screens/BatteryIcon.h displayapp/screens/BatteryIcon.h
displayapp/screens/BleIcon.h displayapp/screens/BleIcon.h
displayapp/screens/NotificationIcon.h displayapp/screens/NotificationIcon.h
displayapp/screens/Brightness.h
displayapp/screens/SystemInfo.h displayapp/screens/SystemInfo.h
displayapp/screens/ScreenList.h displayapp/screens/ScreenList.h
displayapp/screens/Label.h displayapp/screens/Label.h
@ -611,7 +642,6 @@ set(INCLUDE_FILES
displayapp/screens/Timer.h displayapp/screens/Timer.h
displayapp/screens/Alarm.h displayapp/screens/Alarm.h
displayapp/Colors.h displayapp/Colors.h
displayapp/widgets/Counter.h
drivers/St7789.h drivers/St7789.h
drivers/SpiNorFlash.h drivers/SpiNorFlash.h
drivers/SpiMaster.h drivers/SpiMaster.h
@ -678,7 +708,6 @@ set(INCLUDE_FILES
) )
include_directories( include_directories(
${CMAKE_BINARY_DIR}/src # include generated files like Version.h
. .
../ ../
libs/ libs/
@ -780,7 +809,7 @@ add_definitions(-DOS_CPUTIME_FREQ)
add_definitions(-DNRF52 -DNRF52832 -DNRF52832_XXAA -DNRF52_PAN_74 -DNRF52_PAN_64 -DNRF52_PAN_12 -DNRF52_PAN_58 -DNRF52_PAN_54 -DNRF52_PAN_31 -DNRF52_PAN_51 -DNRF52_PAN_36 -DNRF52_PAN_15 -DNRF52_PAN_20 -DNRF52_PAN_55 -DBOARD_PCA10040) add_definitions(-DNRF52 -DNRF52832 -DNRF52832_XXAA -DNRF52_PAN_74 -DNRF52_PAN_64 -DNRF52_PAN_12 -DNRF52_PAN_58 -DNRF52_PAN_54 -DNRF52_PAN_31 -DNRF52_PAN_51 -DNRF52_PAN_36 -DNRF52_PAN_15 -DNRF52_PAN_20 -DNRF52_PAN_55 -DBOARD_PCA10040)
add_definitions(-DFREERTOS) add_definitions(-DFREERTOS)
add_definitions(-D__STACK_SIZE=1024) add_definitions(-D__STACK_SIZE=1024)
add_definitions(-D__HEAP_SIZE=4096) add_definitions(-D__HEAP_SIZE=3072)
# NOTE : Add the following defines to enable debug mode of the NRF SDK: # NOTE : Add the following defines to enable debug mode of the NRF SDK:
#add_definitions(-DDEBUG) #add_definitions(-DDEBUG)
@ -790,15 +819,6 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")
endif () endif ()
add_subdirectory(displayapp/fonts)
target_compile_options(infinitime_fonts PUBLIC
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Og -g3>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Og -g3 -fno-rtti>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Os -fno-rtti>
$<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp>
)
# NRF SDK # NRF SDK
add_library(nrf-sdk STATIC ${SDK_SOURCE_FILES}) add_library(nrf-sdk STATIC ${SDK_SOURCE_FILES})
target_include_directories(nrf-sdk SYSTEM PUBLIC . ../) target_include_directories(nrf-sdk SYSTEM PUBLIC . ../)
@ -872,7 +892,7 @@ set(EXECUTABLE_FILE_NAME ${EXECUTABLE_NAME}-${pinetime_VERSION_MAJOR}.${pinetime
set(NRF5_LINKER_SCRIPT "${CMAKE_SOURCE_DIR}/gcc_nrf52.ld") set(NRF5_LINKER_SCRIPT "${CMAKE_SOURCE_DIR}/gcc_nrf52.ld")
add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES}) add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES})
set_target_properties(${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_FILE_NAME}) set_target_properties(${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_FILE_NAME})
target_link_libraries(${EXECUTABLE_NAME} nimble nrf-sdk lvgl littlefs QCBOR infinitime_fonts) target_link_libraries(${EXECUTABLE_NAME} nimble nrf-sdk lvgl littlefs QCBOR)
target_compile_options(${EXECUTABLE_NAME} PUBLIC target_compile_options(${EXECUTABLE_NAME} PUBLIC
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Og -g3> $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Og -g3>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os> $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os>
@ -893,14 +913,15 @@ add_custom_command(TARGET ${EXECUTABLE_NAME}
COMMAND ${CMAKE_OBJCOPY} -O ihex ${EXECUTABLE_FILE_NAME}.out "${EXECUTABLE_FILE_NAME}.hex" COMMAND ${CMAKE_OBJCOPY} -O ihex ${EXECUTABLE_FILE_NAME}.out "${EXECUTABLE_FILE_NAME}.hex"
COMMENT "post build steps for ${EXECUTABLE_FILE_NAME}") COMMENT "post build steps for ${EXECUTABLE_FILE_NAME}")
# Build binary intended to be used by bootloader # Build binary intended to be used by bootloader
set(EXECUTABLE_MCUBOOT_NAME "pinetime-mcuboot-app") set(EXECUTABLE_MCUBOOT_NAME "pinetime-mcuboot-app")
set(EXECUTABLE_MCUBOOT_FILE_NAME ${EXECUTABLE_MCUBOOT_NAME}-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}) set(EXECUTABLE_MCUBOOT_FILE_NAME ${EXECUTABLE_MCUBOOT_NAME}-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH})
set(IMAGE_MCUBOOT_FILE_NAME ${EXECUTABLE_MCUBOOT_NAME}-image-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.hex) set(IMAGE_MCUBOOT_FILE_NAME ${EXECUTABLE_MCUBOOT_NAME}-image-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.bin)
set(DFU_MCUBOOT_FILE_NAME ${EXECUTABLE_MCUBOOT_NAME}-dfu-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.zip) set(DFU_MCUBOOT_FILE_NAME ${EXECUTABLE_MCUBOOT_NAME}-dfu-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.zip)
set(NRF5_LINKER_SCRIPT_MCUBOOT "${CMAKE_SOURCE_DIR}/gcc_nrf52-mcuboot.ld") set(NRF5_LINKER_SCRIPT_MCUBOOT "${CMAKE_SOURCE_DIR}/gcc_nrf52-mcuboot.ld")
add_executable(${EXECUTABLE_MCUBOOT_NAME} ${SOURCE_FILES}) add_executable(${EXECUTABLE_MCUBOOT_NAME} ${SOURCE_FILES})
target_link_libraries(${EXECUTABLE_MCUBOOT_NAME} nimble nrf-sdk lvgl littlefs QCBOR infinitime_fonts) target_link_libraries(${EXECUTABLE_MCUBOOT_NAME} nimble nrf-sdk lvgl littlefs QCBOR)
set_target_properties(${EXECUTABLE_MCUBOOT_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_MCUBOOT_FILE_NAME}) set_target_properties(${EXECUTABLE_MCUBOOT_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_MCUBOOT_FILE_NAME})
target_compile_options(${EXECUTABLE_MCUBOOT_NAME} PUBLIC target_compile_options(${EXECUTABLE_MCUBOOT_NAME} PUBLIC
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Og -g3> $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Og -g3>
@ -920,7 +941,7 @@ add_custom_command(TARGET ${EXECUTABLE_MCUBOOT_NAME}
COMMAND ${CMAKE_SIZE_UTIL} ${EXECUTABLE_MCUBOOT_FILE_NAME}.out COMMAND ${CMAKE_SIZE_UTIL} ${EXECUTABLE_MCUBOOT_FILE_NAME}.out
COMMAND ${CMAKE_OBJCOPY} -O binary ${EXECUTABLE_MCUBOOT_FILE_NAME}.out "${EXECUTABLE_MCUBOOT_FILE_NAME}.bin" COMMAND ${CMAKE_OBJCOPY} -O binary ${EXECUTABLE_MCUBOOT_FILE_NAME}.out "${EXECUTABLE_MCUBOOT_FILE_NAME}.bin"
COMMAND ${CMAKE_OBJCOPY} -O ihex ${EXECUTABLE_MCUBOOT_FILE_NAME}.out "${EXECUTABLE_MCUBOOT_FILE_NAME}.hex" COMMAND ${CMAKE_OBJCOPY} -O ihex ${EXECUTABLE_MCUBOOT_FILE_NAME}.out "${EXECUTABLE_MCUBOOT_FILE_NAME}.hex"
COMMAND ${CMAKE_SOURCE_DIR}/tools/mcuboot/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header ${EXECUTABLE_MCUBOOT_FILE_NAME}.hex ${IMAGE_MCUBOOT_FILE_NAME} COMMAND ${CMAKE_SOURCE_DIR}/tools/mcuboot/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header ${EXECUTABLE_MCUBOOT_FILE_NAME}.bin ${IMAGE_MCUBOOT_FILE_NAME}
COMMENT "post build steps for ${EXECUTABLE_MCUBOOT_FILE_NAME}" COMMENT "post build steps for ${EXECUTABLE_MCUBOOT_FILE_NAME}"
) )
@ -936,7 +957,7 @@ endif()
set(EXECUTABLE_RECOVERY_NAME "pinetime-recovery") set(EXECUTABLE_RECOVERY_NAME "pinetime-recovery")
set(EXECUTABLE_RECOVERY_FILE_NAME ${EXECUTABLE_RECOVERY_NAME}-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}) set(EXECUTABLE_RECOVERY_FILE_NAME ${EXECUTABLE_RECOVERY_NAME}-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH})
add_executable(${EXECUTABLE_RECOVERY_NAME} ${RECOVERY_SOURCE_FILES}) add_executable(${EXECUTABLE_RECOVERY_NAME} ${RECOVERY_SOURCE_FILES})
target_link_libraries(${EXECUTABLE_RECOVERY_NAME} nimble nrf-sdk littlefs QCBOR infinitime_fonts) target_link_libraries(${EXECUTABLE_RECOVERY_NAME} nimble nrf-sdk littlefs QCBOR)
set_target_properties(${EXECUTABLE_RECOVERY_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERY_FILE_NAME}) set_target_properties(${EXECUTABLE_RECOVERY_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERY_FILE_NAME})
target_compile_definitions(${EXECUTABLE_RECOVERY_NAME} PUBLIC "PINETIME_IS_RECOVERY") target_compile_definitions(${EXECUTABLE_RECOVERY_NAME} PUBLIC "PINETIME_IS_RECOVERY")
target_compile_options(${EXECUTABLE_RECOVERY_NAME} PUBLIC target_compile_options(${EXECUTABLE_RECOVERY_NAME} PUBLIC
@ -963,10 +984,10 @@ add_custom_command(TARGET ${EXECUTABLE_RECOVERY_NAME}
# InfiniTime recovery firmware (mcuboot) # InfiniTime recovery firmware (mcuboot)
set(EXECUTABLE_RECOVERY_MCUBOOT_NAME "pinetime-mcuboot-recovery") set(EXECUTABLE_RECOVERY_MCUBOOT_NAME "pinetime-mcuboot-recovery")
set(EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME ${EXECUTABLE_RECOVERY_MCUBOOT_NAME}-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}) set(EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME ${EXECUTABLE_RECOVERY_MCUBOOT_NAME}-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH})
set(IMAGE_RECOVERY_MCUBOOT_FILE_NAME ${EXECUTABLE_RECOVERY_MCUBOOT_NAME}-image-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.hex) set(IMAGE_RECOVERY_MCUBOOT_FILE_NAME ${EXECUTABLE_RECOVERY_MCUBOOT_NAME}-image-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.bin)
set(DFU_RECOVERY_MCUBOOT_FILE_NAME ${EXECUTABLE_RECOVERY_MCUBOOT_NAME}-dfu-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.zip) set(DFU_RECOVERY_MCUBOOT_FILE_NAME ${EXECUTABLE_RECOVERY_MCUBOOT_NAME}-dfu-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.zip)
add_executable(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} ${RECOVERY_SOURCE_FILES}) add_executable(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} ${RECOVERY_SOURCE_FILES})
target_link_libraries(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} nimble nrf-sdk littlefs QCBOR infinitime_fonts) target_link_libraries(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} nimble nrf-sdk littlefs QCBOR)
set_target_properties(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}) set_target_properties(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME})
target_compile_definitions(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PUBLIC "PINETIME_IS_RECOVERY") target_compile_definitions(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PUBLIC "PINETIME_IS_RECOVERY")
target_compile_options(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PUBLIC target_compile_options(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PUBLIC
@ -979,17 +1000,16 @@ target_compile_options(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PUBLIC
set_target_properties(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PROPERTIES set_target_properties(${EXECUTABLE_RECOVERY_MCUBOOT_NAME} PROPERTIES
SUFFIX ".out" SUFFIX ".out"
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_GRAPHICS_FILE_NAME}.map" 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"
) )
add_custom_command(TARGET ${EXECUTABLE_RECOVERY_MCUBOOT_NAME} add_custom_command(TARGET ${EXECUTABLE_RECOVERY_MCUBOOT_NAME}
POST_BUILD POST_BUILD
COMMAND ${CMAKE_SIZE_UTIL} ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.out COMMAND ${CMAKE_SIZE_UTIL} ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.out
COMMAND ${CMAKE_OBJCOPY} -O binary ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.out "${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.bin" COMMAND ${CMAKE_OBJCOPY} -O binary ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.out "${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.bin"
COMMAND ${CMAKE_OBJCOPY} -O ihex ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.out "${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.hex" COMMAND ${CMAKE_OBJCOPY} -O ihex ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.out "${EXECUTABLE_RECOVERYY_MCUBOOT_FILE_NAME}.hex"
COMMAND ${CMAKE_SOURCE_DIR}/tools/mcuboot/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.hex ${IMAGE_RECOVERY_MCUBOOT_FILE_NAME} COMMAND ${CMAKE_SOURCE_DIR}/tools/mcuboot/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}.bin ${IMAGE_RECOVERY_MCUBOOT_FILE_NAME}
COMMAND ${CMAKE_OBJCOPY} -I ihex -O binary ${IMAGE_RECOVERY_MCUBOOT_FILE_NAME} "${IMAGE_RECOVERY_MCUBOOT_FILE_NAME}.bin" COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/bin2c.py ${IMAGE_RECOVERY_MCUBOOT_FILE_NAME} recoveryImage > recoveryImage.h
COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/bin2c.py ${IMAGE_RECOVERY_MCUBOOT_FILE_NAME}.bin recoveryImage > recoveryImage.h
COMMENT "post build steps for ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}" COMMENT "post build steps for ${EXECUTABLE_RECOVERY_MCUBOOT_FILE_NAME}"
) )
@ -1005,7 +1025,7 @@ endif()
set(EXECUTABLE_RECOVERYLOADER_NAME "pinetime-recovery-loader") set(EXECUTABLE_RECOVERYLOADER_NAME "pinetime-recovery-loader")
set(EXECUTABLE_RECOVERYLOADER_FILE_NAME ${EXECUTABLE_RECOVERYLOADER_NAME}-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}) set(EXECUTABLE_RECOVERYLOADER_FILE_NAME ${EXECUTABLE_RECOVERYLOADER_NAME}-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH})
add_executable(${EXECUTABLE_RECOVERYLOADER_NAME} ${RECOVERYLOADER_SOURCE_FILES}) add_executable(${EXECUTABLE_RECOVERYLOADER_NAME} ${RECOVERYLOADER_SOURCE_FILES})
target_link_libraries(${EXECUTABLE_RECOVERYLOADER_NAME} nrf-sdk QCBOR infinitime_fonts) target_link_libraries(${EXECUTABLE_RECOVERYLOADER_NAME} nrf-sdk QCBOR)
set_target_properties(${EXECUTABLE_RECOVERYLOADER_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERYLOADER_FILE_NAME}) set_target_properties(${EXECUTABLE_RECOVERYLOADER_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_RECOVERYLOADER_FILE_NAME})
target_compile_options(${EXECUTABLE_RECOVERYLOADER_NAME} PUBLIC target_compile_options(${EXECUTABLE_RECOVERYLOADER_NAME} PUBLIC
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Og -g3> $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Og -g3>
@ -1035,10 +1055,10 @@ add_custom_command(TARGET ${EXECUTABLE_RECOVERYLOADER_NAME}
# Build binary that writes the recovery image (MCUBoot version) # Build binary that writes the recovery image (MCUBoot version)
set(EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME "pinetime-mcuboot-recovery-loader") set(EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME "pinetime-mcuboot-recovery-loader")
set(EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME}-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}) set(EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME}-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH})
set(IMAGE_MCUBOOT_RECOVERYLOADER_FILE_NAME ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME}-image-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.hex) set(IMAGE_MCUBOOT_RECOVERYLOADER_FILE_NAME ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME}-image-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.bin)
set(DFU_MCUBOOT_RECOVERYLOADER_FILE_NAME ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME}-dfu-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.zip) set(DFU_MCUBOOT_RECOVERYLOADER_FILE_NAME ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME}-dfu-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.zip)
add_executable(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} ${RECOVERYLOADER_SOURCE_FILES}) add_executable(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} ${RECOVERYLOADER_SOURCE_FILES})
target_link_libraries(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} nrf-sdk QCBOR infinitime_fonts) target_link_libraries(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} nrf-sdk QCBOR)
set_target_properties(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}) set_target_properties(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME})
target_compile_options(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PUBLIC target_compile_options(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PUBLIC
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Og -g3> $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Og -g3>
@ -1062,9 +1082,8 @@ add_custom_command(TARGET ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME}
COMMAND ${CMAKE_SIZE_UTIL} ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.out COMMAND ${CMAKE_SIZE_UTIL} ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.out
COMMAND ${CMAKE_OBJCOPY} -O binary ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.out "${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.bin" COMMAND ${CMAKE_OBJCOPY} -O binary ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.out "${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.bin"
COMMAND ${CMAKE_OBJCOPY} -O ihex ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.out "${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.hex" COMMAND ${CMAKE_OBJCOPY} -O ihex ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.out "${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.hex"
COMMAND ${CMAKE_SOURCE_DIR}/tools/mcuboot/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.hex ${IMAGE_MCUBOOT_RECOVERYLOADER_FILE_NAME} COMMAND ${CMAKE_SOURCE_DIR}/tools/mcuboot/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.bin ${IMAGE_MCUBOOT_RECOVERYLOADER_FILE_NAME}
COMMAND ${CMAKE_OBJCOPY} -I ihex -O binary ${IMAGE_MCUBOOT_RECOVERYLOADER_FILE_NAME} "${IMAGE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.bin" COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/bin2c.py ${IMAGE_MCUBOOT_RECOVERYLOADER_FILE_NAME} recoveryLoaderImage > recoveryLoaderImage.h
COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/bin2c.py ${IMAGE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.bin recoveryLoaderImage > recoveryLoaderImage.h
COMMENT "post build steps for ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}" COMMENT "post build steps for ${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}"
) )

View File

@ -62,7 +62,7 @@
#define configTICK_RATE_HZ 1024 #define configTICK_RATE_HZ 1024
#define configMAX_PRIORITIES (3) #define configMAX_PRIORITIES (3)
#define configMINIMAL_STACK_SIZE (120) #define configMINIMAL_STACK_SIZE (120)
#define configTOTAL_HEAP_SIZE (1024 * 17) #define configTOTAL_HEAP_SIZE (1024 * 14)
#define configMAX_TASK_NAME_LEN (4) #define configMAX_TASK_NAME_LEN (4)
#define configUSE_16_BIT_TICKS 0 #define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1 #define configIDLE_SHOULD_YIELD 1
@ -93,9 +93,9 @@
/* Software timer definitions. */ /* Software timer definitions. */
#define configUSE_TIMERS 1 #define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY (1) #define configTIMER_TASK_PRIORITY (0)
#define configTIMER_QUEUE_LENGTH 32 #define configTIMER_QUEUE_LENGTH 32
#define configTIMER_TASK_STACK_DEPTH (300) #define configTIMER_TASK_STACK_DEPTH (250)
/* Tickless Idle configuration. */ /* Tickless Idle configuration. */
#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2 #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2

View File

@ -1,4 +1,4 @@
#include "buttonhandler/ButtonHandler.h" #include "ButtonHandler.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "buttonhandler/ButtonActions.h" #include "ButtonActions.h"
#include "systemtask/SystemTask.h" #include "systemtask/SystemTask.h"
#include <FreeRTOS.h> #include <FreeRTOS.h>
#include <timers.h> #include <timers.h>

View File

@ -17,6 +17,7 @@
*/ */
#include "components/alarm/AlarmController.h" #include "components/alarm/AlarmController.h"
#include "systemtask/SystemTask.h" #include "systemtask/SystemTask.h"
#include "app_timer.h"
#include "task.h" #include "task.h"
#include <chrono> #include <chrono>
@ -26,16 +27,20 @@ using namespace std::chrono_literals;
AlarmController::AlarmController(Controllers::DateTime& dateTimeController) : dateTimeController {dateTimeController} { AlarmController::AlarmController(Controllers::DateTime& dateTimeController) : dateTimeController {dateTimeController} {
} }
APP_TIMER_DEF(alarmAppTimer);
namespace { namespace {
void SetOffAlarm(TimerHandle_t xTimer) { void SetOffAlarm(void* p_context) {
auto controller = static_cast<Pinetime::Controllers::AlarmController*>(pvTimerGetTimerID(xTimer)); auto* controller = static_cast<Pinetime::Controllers::AlarmController*>(p_context);
if (controller != nullptr) {
controller->SetOffAlarmNow(); controller->SetOffAlarmNow();
} }
} }
}
void AlarmController::Init(System::SystemTask* systemTask) { void AlarmController::Init(System::SystemTask* systemTask) {
app_timer_create(&alarmAppTimer, APP_TIMER_MODE_SINGLE_SHOT, SetOffAlarm);
this->systemTask = systemTask; this->systemTask = systemTask;
alarmTimer = xTimerCreate("Alarm", 1, pdFALSE, this, SetOffAlarm);
} }
void AlarmController::SetAlarmTime(uint8_t alarmHr, uint8_t alarmMin) { void AlarmController::SetAlarmTime(uint8_t alarmHr, uint8_t alarmMin) {
@ -44,12 +49,12 @@ void AlarmController::SetAlarmTime(uint8_t alarmHr, uint8_t alarmMin) {
} }
void AlarmController::ScheduleAlarm() { void AlarmController::ScheduleAlarm() {
// Determine the next time the alarm needs to go off and set the timer // Determine the next time the alarm needs to go off and set the app_timer
xTimerStop(alarmTimer, 0); app_timer_stop(alarmAppTimer);
auto now = dateTimeController.CurrentDateTime(); auto now = dateTimeController.CurrentDateTime();
alarmTime = now; alarmTime = now;
time_t ttAlarmTime = std::chrono::system_clock::to_time_t(std::chrono::time_point_cast<std::chrono::system_clock::duration>(alarmTime)); time_t ttAlarmTime = std::chrono::system_clock::to_time_t(alarmTime);
tm* tmAlarmTime = std::localtime(&ttAlarmTime); tm* tmAlarmTime = std::localtime(&ttAlarmTime);
// If the time being set has already passed today,the alarm should be set for tomorrow // If the time being set has already passed today,the alarm should be set for tomorrow
@ -75,9 +80,8 @@ void AlarmController::ScheduleAlarm() {
// now can convert back to a time_point // now can convert back to a time_point
alarmTime = std::chrono::system_clock::from_time_t(std::mktime(tmAlarmTime)); alarmTime = std::chrono::system_clock::from_time_t(std::mktime(tmAlarmTime));
auto secondsToAlarm = std::chrono::duration_cast<std::chrono::seconds>(alarmTime - now).count(); auto mSecToAlarm = std::chrono::duration_cast<std::chrono::milliseconds>(alarmTime - now).count();
xTimerChangePeriod(alarmTimer, secondsToAlarm * configTICK_RATE_HZ, 0); app_timer_start(alarmAppTimer, APP_TIMER_TICKS(mSecToAlarm), this);
xTimerStart(alarmTimer, 0);
state = AlarmState::Set; state = AlarmState::Set;
} }
@ -87,7 +91,7 @@ uint32_t AlarmController::SecondsToAlarm() {
} }
void AlarmController::DisableAlarm() { void AlarmController::DisableAlarm() {
xTimerStop(alarmTimer, 0); app_timer_stop(alarmAppTimer);
state = AlarmState::Not_Set; state = AlarmState::Not_Set;
} }
@ -97,12 +101,14 @@ void AlarmController::SetOffAlarmNow() {
} }
void AlarmController::StopAlerting() { void AlarmController::StopAlerting() {
systemTask->PushMessage(System::Messages::StopRinging);
// Alarm state is off unless this is a recurring alarm // Alarm state is off unless this is a recurring alarm
if (recurrence == RecurType::None) { if (recurrence == RecurType::None) {
state = AlarmState::Not_Set; state = AlarmState::Not_Set;
} else { } else {
state = AlarmState::Set;
// set next instance // set next instance
ScheduleAlarm(); ScheduleAlarm();
} }
systemTask->PushMessage(System::Messages::StopRinging);
} }

View File

@ -17,8 +17,6 @@
*/ */
#pragma once #pragma once
#include <FreeRTOS.h>
#include <timers.h>
#include <cstdint> #include <cstdint>
#include "components/datetime/DateTimeController.h" #include "components/datetime/DateTimeController.h"
@ -59,7 +57,6 @@ namespace Pinetime {
private: private:
Controllers::DateTime& dateTimeController; Controllers::DateTime& dateTimeController;
System::SystemTask* systemTask = nullptr; System::SystemTask* systemTask = nullptr;
TimerHandle_t alarmTimer;
uint8_t hours = 7; uint8_t hours = 7;
uint8_t minutes = 0; uint8_t minutes = 0;
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> alarmTime; std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> alarmTime;

View File

@ -1,109 +0,0 @@
/* Copyright (C) 2021 Adam Pigg
This file is part of InfiniTime.
InfiniTime is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
InfiniTime is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "components/ble/AgendaService.h"
#include "systemtask/SystemTask.h"
namespace {
// 3fdaYYXX-e246-472e-b7e0-d2b0f3d9c17a
constexpr ble_uuid128_t CharUuid(uint8_t x, uint8_t y) {
return ble_uuid128_t {.u = {.type = BLE_UUID_TYPE_128},
.value = {0x7a, 0xc1, 0xd9, 0xf3, 0xb0, 0xd2, 0xe0, 0xb7, 0x2e, 0x47, 0x46, 0xe2, x, y, 0xda, 0x3f}};
}
// 00010000-78fc-48fe-8e23-433b3a1942d0
constexpr ble_uuid128_t BaseUuid() {
return CharUuid(0x00, 0x00);
}
constexpr ble_uuid128_t agendaUuid {BaseUuid()};
constexpr ble_uuid128_t agendaItemCharUuid {CharUuid(0x01, 0x00)};
/*constexpr ble_uuid128_t navNarrativeCharUuid {CharUuid(0x02, 0x00)};
constexpr ble_uuid128_t navManDistCharUuid {CharUuid(0x03, 0x00)};
constexpr ble_uuid128_t navProgressCharUuid {CharUuid(0x04, 0x00)};*/
int AgendaCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt, void* arg) {
auto agendaService = static_cast<Pinetime::Controllers::AgendaService*>(arg);
return agendaService->OnCommand(conn_handle, attr_handle, ctxt);
}
} // namespace
Pinetime::Controllers::AgendaService::AgendaService(Pinetime::System::SystemTask& system) : m_system(system) {
characteristicDefinition[0] = {.uuid = &agendaItemCharUuid.u,
.access_cb = AgendaCallback,
.arg = this,
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ};
characteristicDefinition[1] = {0};
serviceDefinition[0] = {.type = BLE_GATT_SVC_TYPE_PRIMARY, .uuid = &agendaUuid.u, .characteristics = characteristicDefinition};
serviceDefinition[1] = {0};
}
void Pinetime::Controllers::AgendaService::Init() {
int res = 0;
res = ble_gatts_count_cfg(serviceDefinition);
ASSERT(res == 0);
res = ble_gatts_add_svcs(serviceDefinition);
ASSERT(res == 0);
m_agenda_times[0] = 1655327841;
m_agenda_pieces[0] = "C++ Fumbling";
}
int Pinetime::Controllers::AgendaService::OnCommand(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt) {
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
size_t notifSize = OS_MBUF_PKTLEN(ctxt->om);
uint8_t data[notifSize + 1];
data[notifSize] = '\0';
os_mbuf_copydata(ctxt->om, 0, notifSize, data);
if (ble_uuid_cmp(ctxt->chr->uuid, &agendaItemCharUuid.u) == 0) {
if (notifSize >= 5) {
uint8_t itemIndex = (uint8_t) data[0];
uint32_t itemTime = ((uint32_t) data[1]) << 24 | ((uint32_t) data[2]) << 16 | ((uint32_t) data[3]) << 8 | ((uint32_t) data[4]);
char* sAgendaItem = (char*) &data[5];
if (itemIndex < AGENDA_CAPACITY) { // don't allow a buffer overflow
m_agenda_times[itemIndex] = itemTime;
// implicit std::string copy/conversion here:
m_agenda_pieces[itemIndex] = sAgendaItem;
}
}
}
}
return 0;
}
uint32_t Pinetime::Controllers::AgendaService::getAgendaTime(uint8_t index) {
if (index < AGENDA_CAPACITY) {
return m_agenda_times[index];
} else {
return 0;
}
}
std::string Pinetime::Controllers::AgendaService::getAgendaPiece(uint8_t index) {
if (index < AGENDA_CAPACITY) {
return m_agenda_pieces[index];
} else {
return 0;
}
}

View File

@ -1,59 +0,0 @@
/* Copyright (C) 2021 Adam Pigg
This file is part of InfiniTime.
InfiniTime is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
InfiniTime is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <cstdint>
#include <string>
#define min // workaround: nimble's min/max macros conflict with libstdc++
#define max
#include <host/ble_gap.h>
#include <host/ble_uuid.h>
#undef max
#undef min
namespace Pinetime {
namespace System {
class SystemTask;
}
namespace Controllers {
class AgendaService {
public:
static const uint8_t AGENDA_CAPACITY = 35;
explicit AgendaService(Pinetime::System::SystemTask& system);
void Init();
int OnCommand(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt);
uint32_t getAgendaTime(uint8_t index);
std::string getAgendaPiece(uint8_t index);
private:
struct ble_gatt_chr_def characteristicDefinition[2];
struct ble_gatt_svc_def serviceDefinition[2];
uint32_t m_agenda_times[AGENDA_CAPACITY];
std::string m_agenda_pieces[AGENDA_CAPACITY];
Pinetime::System::SystemTask& m_system;
};
}
}

View File

@ -2,7 +2,6 @@
#include <algorithm> #include <algorithm>
#include "components/ble/NotificationManager.h" #include "components/ble/NotificationManager.h"
#include "systemtask/SystemTask.h" #include "systemtask/SystemTask.h"
#include <nrf_log.h>
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
constexpr ble_uuid16_t AlertNotificationClient::ansServiceUuid; constexpr ble_uuid16_t AlertNotificationClient::ansServiceUuid;
@ -26,11 +25,8 @@ namespace {
return client->OnCharacteristicsDiscoveryEvent(conn_handle, error, chr); return client->OnCharacteristicsDiscoveryEvent(conn_handle, error, chr);
} }
int OnAlertNotificationDescriptorDiscoveryEventCallback(uint16_t conn_handle, int OnAlertNotificationDescriptorDiscoveryEventCallback(
const struct ble_gatt_error* error, uint16_t conn_handle, const struct ble_gatt_error* error, uint16_t chr_val_handle, const struct ble_gatt_dsc* dsc, void* arg) {
uint16_t chr_val_handle,
const struct ble_gatt_dsc* dsc,
void* arg) {
auto client = static_cast<AlertNotificationClient*>(arg); auto client = static_cast<AlertNotificationClient*>(arg);
return client->OnDescriptorDiscoveryEventCallback(conn_handle, error, chr_val_handle, dsc); return client->OnDescriptorDiscoveryEventCallback(conn_handle, error, chr_val_handle, dsc);
} }

View File

@ -18,7 +18,6 @@ namespace Pinetime {
int OnBatteryServiceRequested(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt* context); int OnBatteryServiceRequested(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt* context);
void NotifyBatteryLevel(uint16_t connectionHandle, uint8_t level); void NotifyBatteryLevel(uint16_t connectionHandle, uint8_t level);
private: private:
Controllers::Battery& batteryController; Controllers::Battery& batteryController;
static constexpr uint16_t batteryInformationServiceId {0x180F}; static constexpr uint16_t batteryInformationServiceId {0x180F};

View File

@ -2,10 +2,6 @@
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
bool Ble::IsConnected() const {
return isConnected;
}
void Ble::Connect() { void Ble::Connect() {
isConnected = true; isConnected = true;
} }
@ -14,18 +10,6 @@ void Ble::Disconnect() {
isConnected = false; isConnected = false;
} }
bool Ble::IsRadioEnabled() const {
return isRadioEnabled;
}
void Ble::EnableRadio() {
isRadioEnabled = true;
}
void Ble::DisableRadio() {
isRadioEnabled = false;
}
void Ble::StartFirmwareUpdate() { void Ble::StartFirmwareUpdate() {
isFirmwareUpdating = true; isFirmwareUpdating = true;
} }

View File

@ -12,14 +12,12 @@ namespace Pinetime {
enum class AddressTypes { Public, Random, RPA_Public, RPA_Random }; enum class AddressTypes { Public, Random, RPA_Public, RPA_Random };
Ble() = default; Ble() = default;
bool IsConnected() const; bool IsConnected() const {
return isConnected;
}
void Connect(); void Connect();
void Disconnect(); void Disconnect();
bool IsRadioEnabled() const;
void EnableRadio();
void DisableRadio();
void StartFirmwareUpdate(); void StartFirmwareUpdate();
void StopFirmwareUpdate(); void StopFirmwareUpdate();
void FirmwareUpdateTotalBytes(uint32_t totalBytes); void FirmwareUpdateTotalBytes(uint32_t totalBytes);
@ -59,7 +57,6 @@ namespace Pinetime {
private: private:
bool isConnected = false; bool isConnected = false;
bool isRadioEnabled = true;
bool isFirmwareUpdating = false; bool isFirmwareUpdating = false;
uint32_t firmwareUpdateTotalBytes = 0; uint32_t firmwareUpdateTotalBytes = 0;
uint32_t firmwareUpdateCurrentBytes = 0; uint32_t firmwareUpdateCurrentBytes = 0;

View File

@ -85,21 +85,10 @@ int CurrentTimeClient::OnCurrentTimeReadResult(uint16_t conn_handle, const ble_g
// TODO check that attribute->handle equals the handle discovered in OnCharacteristicDiscoveryEvent // TODO check that attribute->handle equals the handle discovered in OnCharacteristicDiscoveryEvent
CtsData result; CtsData result;
os_mbuf_copydata(attribute->om, 0, sizeof(CtsData), &result); os_mbuf_copydata(attribute->om, 0, sizeof(CtsData), &result);
NRF_LOG_INFO("Received data: %d-%d-%d %d:%d:%d", NRF_LOG_INFO(
result.year, "Received data: %d-%d-%d %d:%d:%d", result.year, result.month, result.dayofmonth, result.hour, result.minute, result.second);
result.month, dateTimeController.SetTime(
result.dayofmonth, result.year, result.month, result.dayofmonth, 0, result.hour, result.minute, result.second, nrf_rtc_counter_get(portNRF_RTC_REG));
result.hour,
result.minute,
result.second);
dateTimeController.SetTime(result.year,
result.month,
result.dayofmonth,
0,
result.hour,
result.minute,
result.second,
nrf_rtc_counter_get(portNRF_RTC_REG));
} else { } else {
NRF_LOG_INFO("Error retrieving current time: %d", error->status); NRF_LOG_INFO("Error retrieving current time: %d", error->status);
} }

View File

@ -29,22 +29,11 @@ int CurrentTimeService::OnTimeAccessed(uint16_t conn_handle, uint16_t attr_handl
CtsData result; CtsData result;
os_mbuf_copydata(ctxt->om, 0, sizeof(CtsData), &result); os_mbuf_copydata(ctxt->om, 0, sizeof(CtsData), &result);
NRF_LOG_INFO("Received data: %d-%d-%d %d:%d:%d", NRF_LOG_INFO(
result.year, "Received data: %d-%d-%d %d:%d:%d", result.year, result.month, result.dayofmonth, result.hour, result.minute, result.second);
result.month,
result.dayofmonth,
result.hour,
result.minute,
result.second);
m_dateTimeController.SetTime(result.year, m_dateTimeController.SetTime(
result.month, result.year, result.month, result.dayofmonth, 0, result.hour, result.minute, result.second, nrf_rtc_counter_get(portNRF_RTC_REG));
result.dayofmonth,
0,
result.hour,
result.minute,
result.second,
nrf_rtc_counter_get(portNRF_RTC_REG));
} else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) { } else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) {
CtsData currentDateTime; CtsData currentDateTime;

View File

@ -3,7 +3,6 @@
#include "components/ble/BleController.h" #include "components/ble/BleController.h"
#include "drivers/SpiNorFlash.h" #include "drivers/SpiNorFlash.h"
#include "systemtask/SystemTask.h" #include "systemtask/SystemTask.h"
#include <nrf_log.h>
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
@ -119,10 +118,8 @@ int DfuService::WritePacketHandler(uint16_t connectionHandle, os_mbuf* om) {
bootloaderSize = om->om_data[4] + (om->om_data[5] << 8) + (om->om_data[6] << 16) + (om->om_data[7] << 24); bootloaderSize = om->om_data[4] + (om->om_data[5] << 8) + (om->om_data[6] << 16) + (om->om_data[7] << 24);
applicationSize = om->om_data[8] + (om->om_data[9] << 8) + (om->om_data[10] << 16) + (om->om_data[11] << 24); applicationSize = om->om_data[8] + (om->om_data[9] << 8) + (om->om_data[10] << 16) + (om->om_data[11] << 24);
bleController.FirmwareUpdateTotalBytes(applicationSize); bleController.FirmwareUpdateTotalBytes(applicationSize);
NRF_LOG_INFO("[DFU] -> Start data received : SD size : %d, BT size : %d, app size : %d", NRF_LOG_INFO(
softdeviceSize, "[DFU] -> Start data received : SD size : %d, BT size : %d, app size : %d", softdeviceSize, bootloaderSize, applicationSize);
bootloaderSize,
applicationSize);
// wait until SystemTask has finished waking up all devices // wait until SystemTask has finished waking up all devices
while (systemTask.IsSleeping()) { while (systemTask.IsSleeping()) {
@ -167,10 +164,10 @@ int DfuService::WritePacketHandler(uint16_t connectionHandle, os_mbuf* om) {
if ((nbPacketReceived % nbPacketsToNotify) == 0 && bytesReceived != applicationSize) { if ((nbPacketReceived % nbPacketsToNotify) == 0 && bytesReceived != applicationSize) {
uint8_t data[5] {static_cast<uint8_t>(Opcodes::PacketReceiptNotification), uint8_t data[5] {static_cast<uint8_t>(Opcodes::PacketReceiptNotification),
static_cast<uint8_t>(bytesReceived & 0x000000FFu), (uint8_t)(bytesReceived & 0x000000FFu),
static_cast<uint8_t>(bytesReceived >> 8u), (uint8_t)(bytesReceived >> 8u),
static_cast<uint8_t>(bytesReceived >> 16u), (uint8_t)(bytesReceived >> 16u),
static_cast<uint8_t>(bytesReceived >> 24u)}; (uint8_t)(bytesReceived >> 24u)};
NRF_LOG_INFO("[DFU] -> Send packet notification: %d bytes received", bytesReceived); NRF_LOG_INFO("[DFU] -> Send packet notification: %d bytes received", bytesReceived);
notificationManager.Send(connectionHandle, controlPointCharacteristicHandle, data, 5); notificationManager.Send(connectionHandle, controlPointCharacteristicHandle, data, 5);
} }
@ -246,7 +243,7 @@ int DfuService::ControlPointHandler(uint16_t connectionHandle, os_mbuf* om) {
NRF_LOG_INFO("[DFU] -> Receive firmware image requested, but we are not in Start Init"); NRF_LOG_INFO("[DFU] -> Receive firmware image requested, but we are not in Start Init");
return 0; return 0;
} }
// TODO the chunk size is dependent of the implementation of the host application... // TODO the chunk size is dependant of the implementation of the host application...
dfuImage.Init(20, applicationSize, expectedCrc); dfuImage.Init(20, applicationSize, expectedCrc);
NRF_LOG_INFO("[DFU] -> Starting receive firmware"); NRF_LOG_INFO("[DFU] -> Starting receive firmware");
state = States::Data; state = States::Data;
@ -425,9 +422,9 @@ uint16_t DfuService::DfuImage::ComputeCrc(uint8_t const* p_data, uint32_t size,
uint16_t crc = (p_crc == NULL) ? 0xFFFF : *p_crc; uint16_t crc = (p_crc == NULL) ? 0xFFFF : *p_crc;
for (uint32_t i = 0; i < size; i++) { for (uint32_t i = 0; i < size; i++) {
crc = static_cast<uint8_t>(crc >> 8) | (crc << 8); crc = (uint8_t)(crc >> 8) | (crc << 8);
crc ^= p_data[i]; crc ^= p_data[i];
crc ^= static_cast<uint8_t>(crc & 0xFF) >> 4; crc ^= (uint8_t)(crc & 0xFF) >> 4;
crc ^= (crc << 8) << 4; crc ^= (crc << 8) << 4;
crc ^= ((crc & 0xFF) << 4) << 1; crc ^= ((crc & 0xFF) << 4) << 1;
} }

View File

@ -81,7 +81,7 @@ int FSService::FSCommandHandler(uint16_t connectionHandle, os_mbuf* om) {
return -1; return -1;
} }
memcpy(filepath, header->pathstr, plen); memcpy(filepath, header->pathstr, plen);
filepath[plen] = 0; // Copy and null terminate string filepath[plen] = 0; // Copy and null teminate string
ReadResponse resp; ReadResponse resp;
os_mbuf* om; os_mbuf* om;
resp.command = commands::READ_DATA; resp.command = commands::READ_DATA;
@ -148,7 +148,7 @@ int FSService::FSCommandHandler(uint16_t connectionHandle, os_mbuf* om) {
return -1; // TODO make this actually return a BLE notif return -1; // TODO make this actually return a BLE notif
} }
memcpy(filepath, header->pathstr, plen); memcpy(filepath, header->pathstr, plen);
filepath[plen] = 0; // Copy and null terminate string filepath[plen] = 0; // Copy and null teminate string
fileSize = header->totalSize; fileSize = header->totalSize;
WriteResponse resp; WriteResponse resp;
resp.command = commands::WRITE_PACING; resp.command = commands::WRITE_PACING;
@ -193,7 +193,7 @@ int FSService::FSCommandHandler(uint16_t connectionHandle, os_mbuf* om) {
uint16_t plen = header->pathlen; uint16_t plen = header->pathlen;
char path[plen + 1] = {0}; char path[plen + 1] = {0};
memcpy(path, header->pathstr, plen); memcpy(path, header->pathstr, plen);
path[plen] = 0; // Copy and null terminate string path[plen] = 0; // Copy and null teminate string
DelResponse resp {}; DelResponse resp {};
resp.command = commands::DELETE_STATUS; resp.command = commands::DELETE_STATUS;
int res = fs.FileDelete(path); int res = fs.FileDelete(path);
@ -208,7 +208,7 @@ int FSService::FSCommandHandler(uint16_t connectionHandle, os_mbuf* om) {
uint16_t plen = header->pathlen; uint16_t plen = header->pathlen;
char path[plen + 1] = {0}; char path[plen + 1] = {0};
memcpy(path, header->pathstr, plen); memcpy(path, header->pathstr, plen);
path[plen] = 0; // Copy and null terminate string path[plen] = 0; // Copy and null teminate string
MKDirResponse resp {}; MKDirResponse resp {};
resp.command = commands::MKDIR_STATUS; resp.command = commands::MKDIR_STATUS;
resp.modification_time = 0; resp.modification_time = 0;
@ -223,7 +223,7 @@ int FSService::FSCommandHandler(uint16_t connectionHandle, os_mbuf* om) {
ListDirHeader* header = (ListDirHeader*) om->om_data; ListDirHeader* header = (ListDirHeader*) om->om_data;
uint16_t plen = header->pathlen; uint16_t plen = header->pathlen;
char path[plen + 1] = {0}; char path[plen + 1] = {0};
path[plen] = 0; // Copy and null terminate string path[plen] = 0; // Copy and null teminate string
memcpy(path, header->pathstr, plen); memcpy(path, header->pathstr, plen);
ListDirResponse resp {}; ListDirResponse resp {};
@ -290,7 +290,7 @@ int FSService::FSCommandHandler(uint16_t connectionHandle, os_mbuf* om) {
header->pathstr[plen] = 0; header->pathstr[plen] = 0;
char path[header->NewPathLength + 1] = {0}; char path[header->NewPathLength + 1] = {0};
memcpy(path, &header->pathstr[plen + 1], header->NewPathLength); memcpy(path, &header->pathstr[plen + 1], header->NewPathLength);
path[header->NewPathLength] = 0; // Copy and null terminate string path[header->NewPathLength] = 0; // Copy and null teminate string
MoveResponse resp {}; MoveResponse resp {};
resp.command = commands::MOVE_STATUS; resp.command = commands::MOVE_STATUS;
int8_t res = (int8_t) fs.Rename(header->pathstr, path); int8_t res = (int8_t) fs.Rename(header->pathstr, path);

View File

@ -1,7 +1,6 @@
#include "components/ble/HeartRateService.h" #include "components/ble/HeartRateService.h"
#include "components/heartrate/HeartRateController.h" #include "components/heartrate/HeartRateController.h"
#include "systemtask/SystemTask.h" #include "systemtask/SystemTask.h"
#include <nrf_log.h>
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
@ -57,8 +56,7 @@ int HeartRateService::OnHeartRateRequested(uint16_t connectionHandle, uint16_t a
} }
void HeartRateService::OnNewHeartRateValue(uint8_t heartRateValue) { void HeartRateService::OnNewHeartRateValue(uint8_t heartRateValue) {
if (!heartRateMeasurementNotificationEnable) if(!heartRateMeasurementNotificationEnable) return;
return;
uint8_t buffer[2] = {0, heartRateController.HeartRate()}; // [0] = flags, [1] = hr value uint8_t buffer[2] = {0, heartRateController.HeartRate()}; // [0] = flags, [1] = hr value
auto* om = ble_hs_mbuf_from_flat(buffer, 2); auto* om = ble_hs_mbuf_from_flat(buffer, 2);

View File

@ -1,15 +1,16 @@
#include "components/ble/MotionService.h" #include "components/ble/MotionService.h"
#include "components/motion/MotionController.h" #include "components/motion/MotionController.h"
#include "systemtask/SystemTask.h" #include "systemtask/SystemTask.h"
#include <nrf_log.h>
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
namespace { namespace {
// 0003yyxx-78fc-48fe-8e23-433b3a1942d0 // 0003yyxx-78fc-48fe-8e23-433b3a1942d0
constexpr ble_uuid128_t CharUuid(uint8_t x, uint8_t y) { constexpr ble_uuid128_t CharUuid(uint8_t x, uint8_t y) {
return ble_uuid128_t {.u = {.type = BLE_UUID_TYPE_128}, return ble_uuid128_t{
.value = {0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, x, y, 0x03, 0x00}}; .u = {.type = BLE_UUID_TYPE_128},
.value = { 0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, x, y, 0x03, 0x00 }
};
} }
// 00030000-78fc-48fe-8e23-433b3a1942d0 // 00030000-78fc-48fe-8e23-433b3a1942d0
@ -43,7 +44,11 @@ MotionService::MotionService(Pinetime::System::SystemTask& system, Controllers::
.val_handle = &motionValuesHandle}, .val_handle = &motionValuesHandle},
{0}}, {0}},
serviceDefinition { serviceDefinition {
{.type = BLE_GATT_SVC_TYPE_PRIMARY, .uuid = &motionServiceUuid.u, .characteristics = characteristicDefinition}, {
.type = BLE_GATT_SVC_TYPE_PRIMARY,
.uuid = &motionServiceUuid.u,
.characteristics = characteristicDefinition
},
{0}, {0},
} { } {
// TODO refactor to prevent this loop dependency (service depends on controller and controller depends on service) // TODO refactor to prevent this loop dependency (service depends on controller and controller depends on service)
@ -76,8 +81,7 @@ int MotionService::OnStepCountRequested(uint16_t connectionHandle, uint16_t attr
} }
void MotionService::OnNewStepCountValue(uint32_t stepCount) { void MotionService::OnNewStepCountValue(uint32_t stepCount) {
if (!stepCountNoficationEnabled) if(!stepCountNoficationEnabled) return;
return;
uint32_t buffer = stepCount; uint32_t buffer = stepCount;
auto* om = ble_hs_mbuf_from_flat(&buffer, 4); auto* om = ble_hs_mbuf_from_flat(&buffer, 4);
@ -91,8 +95,7 @@ void MotionService::OnNewStepCountValue(uint32_t stepCount) {
ble_gattc_notify_custom(connectionHandle, stepCountHandle, om); ble_gattc_notify_custom(connectionHandle, stepCountHandle, om);
} }
void MotionService::OnNewMotionValues(int16_t x, int16_t y, int16_t z) { void MotionService::OnNewMotionValues(int16_t x, int16_t y, int16_t z) {
if (!motionValuesNoficationEnabled) if(!motionValuesNoficationEnabled) return;
return;
int16_t buffer[3] = { motionController.X(), motionController.Y(), motionController.Z() }; int16_t buffer[3] = { motionController.X(), motionController.Y(), motionController.Z() };
auto* om = ble_hs_mbuf_from_flat(buffer, 3 * sizeof(int16_t)); auto* om = ble_hs_mbuf_from_flat(buffer, 3 * sizeof(int16_t));

View File

@ -17,13 +17,14 @@
*/ */
#include "components/ble/MusicService.h" #include "components/ble/MusicService.h"
#include "systemtask/SystemTask.h" #include "systemtask/SystemTask.h"
#include <cstring>
namespace { namespace {
// 0000yyxx-78fc-48fe-8e23-433b3a1942d0 // 0000yyxx-78fc-48fe-8e23-433b3a1942d0
constexpr ble_uuid128_t CharUuid(uint8_t x, uint8_t y) { constexpr ble_uuid128_t CharUuid(uint8_t x, uint8_t y) {
return ble_uuid128_t {.u = {.type = BLE_UUID_TYPE_128}, return ble_uuid128_t{
.value = {0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, x, y, 0x00, 0x00}}; .u = {.type = BLE_UUID_TYPE_128},
.value = { 0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, x, y, 0x00, 0x00 }
};
} }
// 00000000-78fc-48fe-8e23-433b3a1942d0 // 00000000-78fc-48fe-8e23-433b3a1942d0
@ -46,8 +47,6 @@ namespace {
constexpr ble_uuid128_t msRepeatCharUuid {CharUuid(0x0b, 0x00)}; constexpr ble_uuid128_t msRepeatCharUuid {CharUuid(0x0b, 0x00)};
constexpr ble_uuid128_t msShuffleCharUuid {CharUuid(0x0c, 0x00)}; constexpr ble_uuid128_t msShuffleCharUuid {CharUuid(0x0c, 0x00)};
constexpr uint8_t MaxStringSize {40};
int MusicCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt, void* arg) { int MusicCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt, void* arg) {
return static_cast<Pinetime::Controllers::MusicService*>(arg)->OnCommand(conn_handle, attr_handle, ctxt); return static_cast<Pinetime::Controllers::MusicService*>(arg)->OnCommand(conn_handle, attr_handle, ctxt);
} }
@ -109,7 +108,8 @@ Pinetime::Controllers::MusicService::MusicService(Pinetime::System::SystemTask&
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ}; .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ};
characteristicDefinition[13] = {0}; characteristicDefinition[13] = {0};
serviceDefinition[0] = {.type = BLE_GATT_SVC_TYPE_PRIMARY, .uuid = &msUuid.u, .characteristics = characteristicDefinition}; serviceDefinition[0] = {
.type = BLE_GATT_SVC_TYPE_PRIMARY, .uuid = &msUuid.u, .characteristics = characteristicDefinition};
serviceDefinition[1] = {0}; serviceDefinition[1] = {0};
} }
@ -125,21 +125,9 @@ void Pinetime::Controllers::MusicService::Init() {
int Pinetime::Controllers::MusicService::OnCommand(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt) { int Pinetime::Controllers::MusicService::OnCommand(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt) {
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
size_t notifSize = OS_MBUF_PKTLEN(ctxt->om); size_t notifSize = OS_MBUF_PKTLEN(ctxt->om);
size_t bufferSize = notifSize; char data[notifSize + 1];
if (notifSize > MaxStringSize) { data[notifSize] = '\0';
bufferSize = MaxStringSize; os_mbuf_copydata(ctxt->om, 0, notifSize, data);
}
char data[bufferSize + 1];
os_mbuf_copydata(ctxt->om, 0, bufferSize, data);
if (notifSize > bufferSize) {
data[bufferSize - 1] = '.';
data[bufferSize - 2] = '.';
data[bufferSize - 3] = '.';
}
data[bufferSize] = '\0';
char* s = &data[0]; char* s = &data[0];
if (ble_uuid_cmp(ctxt->chr->uuid, &msArtistCharUuid.u) == 0) { if (ble_uuid_cmp(ctxt->chr->uuid, &msArtistCharUuid.u) == 0) {
artistName = s; artistName = s;
@ -149,21 +137,12 @@ int Pinetime::Controllers::MusicService::OnCommand(uint16_t conn_handle, uint16_
albumName = s; albumName = s;
} else if (ble_uuid_cmp(ctxt->chr->uuid, &msStatusCharUuid.u) == 0) { } else if (ble_uuid_cmp(ctxt->chr->uuid, &msStatusCharUuid.u) == 0) {
playing = s[0]; playing = s[0];
// These variables need to be updated, because the progress may not be updated immediately,
// leading to getProgress() returning an incorrect position.
if (playing) {
trackProgressUpdateTime = xTaskGetTickCount();
} else {
trackProgress +=
static_cast<int>((static_cast<float>(xTaskGetTickCount() - trackProgressUpdateTime) / 1024.0f) * getPlaybackSpeed());
}
} else if (ble_uuid_cmp(ctxt->chr->uuid, &msRepeatCharUuid.u) == 0) { } else if (ble_uuid_cmp(ctxt->chr->uuid, &msRepeatCharUuid.u) == 0) {
repeat = s[0]; repeat = s[0];
} else if (ble_uuid_cmp(ctxt->chr->uuid, &msShuffleCharUuid.u) == 0) { } else if (ble_uuid_cmp(ctxt->chr->uuid, &msShuffleCharUuid.u) == 0) {
shuffle = s[0]; shuffle = s[0];
} else if (ble_uuid_cmp(ctxt->chr->uuid, &msPositionCharUuid.u) == 0) { } else if (ble_uuid_cmp(ctxt->chr->uuid, &msPositionCharUuid.u) == 0) {
trackProgress = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3]; trackProgress = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3];
trackProgressUpdateTime = xTaskGetTickCount();
} else if (ble_uuid_cmp(ctxt->chr->uuid, &msTotalLengthCharUuid.u) == 0) { } else if (ble_uuid_cmp(ctxt->chr->uuid, &msTotalLengthCharUuid.u) == 0) {
trackLength = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3]; trackLength = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3];
} else if (ble_uuid_cmp(ctxt->chr->uuid, &msTrackNumberCharUuid.u) == 0) { } else if (ble_uuid_cmp(ctxt->chr->uuid, &msTrackNumberCharUuid.u) == 0) {
@ -198,10 +177,6 @@ float Pinetime::Controllers::MusicService::getPlaybackSpeed() const {
} }
int Pinetime::Controllers::MusicService::getProgress() const { int Pinetime::Controllers::MusicService::getProgress() const {
if (isPlaying()) {
return trackProgress +
static_cast<int>((static_cast<float>(xTaskGetTickCount() - trackProgressUpdateTime) / 1024.0f) * getPlaybackSpeed());
}
return trackProgress; return trackProgress;
} }

View File

@ -81,7 +81,6 @@ namespace Pinetime {
int trackLength {0}; int trackLength {0};
int trackNumber {}; int trackNumber {};
int tracksTotal {}; int tracksTotal {};
TickType_t trackProgressUpdateTime {0};
float playbackSpeed {1.0f}; float playbackSpeed {1.0f};

View File

@ -46,23 +46,15 @@ namespace {
} // namespace } // namespace
Pinetime::Controllers::NavigationService::NavigationService(Pinetime::System::SystemTask& system) : m_system(system) { Pinetime::Controllers::NavigationService::NavigationService(Pinetime::System::SystemTask& system) : m_system(system) {
characteristicDefinition[0] = {.uuid = &navFlagCharUuid.u, characteristicDefinition[0] = {
.access_cb = NAVCallback, .uuid = &navFlagCharUuid.u, .access_cb = NAVCallback, .arg = this, .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ};
.arg = this,
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ};
characteristicDefinition[1] = {.uuid = &navNarrativeCharUuid.u, characteristicDefinition[1] = {
.access_cb = NAVCallback, .uuid = &navNarrativeCharUuid.u, .access_cb = NAVCallback, .arg = this, .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ};
.arg = this, characteristicDefinition[2] = {
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ}; .uuid = &navManDistCharUuid.u, .access_cb = NAVCallback, .arg = this, .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ};
characteristicDefinition[2] = {.uuid = &navManDistCharUuid.u, characteristicDefinition[3] = {
.access_cb = NAVCallback, .uuid = &navProgressCharUuid.u, .access_cb = NAVCallback, .arg = this, .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ};
.arg = this,
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ};
characteristicDefinition[3] = {.uuid = &navProgressCharUuid.u,
.access_cb = NAVCallback,
.arg = this,
.flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ};
characteristicDefinition[4] = {0}; characteristicDefinition[4] = {0};

View File

@ -2,7 +2,6 @@
#include <cstring> #include <cstring>
#include <hal/nrf_rtc.h> #include <hal/nrf_rtc.h>
#include <nrf_log.h>
#define min // workaround: nimble's min/max macros conflict with libstdc++ #define min // workaround: nimble's min/max macros conflict with libstdc++
#define max #define max
#include <host/ble_gap.h> #include <host/ble_gap.h>
@ -24,17 +23,18 @@
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask, NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask,
Ble& bleController, Pinetime::Controllers::Ble& bleController,
DateTime& dateTimeController, DateTime& dateTimeController,
NotificationManager& notificationManager, Pinetime::Controllers::NotificationManager& notificationManager,
Battery& batteryController, Controllers::Battery& batteryController,
Pinetime::Drivers::SpiNorFlash& spiNorFlash, Pinetime::Drivers::SpiNorFlash& spiNorFlash,
HeartRateController& heartRateController, Controllers::HeartRateController& heartRateController,
MotionController& motionController, Controllers::MotionController& motionController,
FS& fs) Controllers::FS& fs)
: systemTask {systemTask}, : systemTask {systemTask},
bleController {bleController}, bleController {bleController},
dateTimeController {dateTimeController}, dateTimeController {dateTimeController},
notificationManager {notificationManager},
spiNorFlash {spiNorFlash}, spiNorFlash {spiNorFlash},
fs {fs}, fs {fs},
dfuService {systemTask, bleController, spiNorFlash}, dfuService {systemTask, bleController, spiNorFlash},
@ -51,7 +51,6 @@ NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask,
heartRateService {systemTask, heartRateController}, heartRateService {systemTask, heartRateController},
motionService {systemTask, motionController}, motionService {systemTask, motionController},
fsService {systemTask, fs}, fsService {systemTask, fs},
agendaService {systemTask},
serviceDiscovery({&currentTimeClient, &alertNotificationClient}) { serviceDiscovery({&currentTimeClient, &alertNotificationClient}) {
} }
@ -77,7 +76,6 @@ int GAPEventCallback(struct ble_gap_event* event, void* arg) {
void NimbleController::Init() { void NimbleController::Init() {
while (!ble_hs_synced()) { while (!ble_hs_synced()) {
vTaskDelay(10);
} }
nptr = this; nptr = this;
@ -94,7 +92,6 @@ void NimbleController::Init() {
musicService.Init(); musicService.Init();
weatherService.Init(); weatherService.Init();
navService.Init(); navService.Init();
agendaService.Init();
anService.Init(); anService.Init();
dfuService.Init(); dfuService.Init();
batteryInformationService.Init(); batteryInformationService.Init();
@ -187,9 +184,7 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
case BLE_GAP_EVENT_ADV_COMPLETE: case BLE_GAP_EVENT_ADV_COMPLETE:
NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_ADV_COMPLETE"); NRF_LOG_INFO("Advertising event : BLE_GAP_EVENT_ADV_COMPLETE");
NRF_LOG_INFO("reason=%d; status=%0X", event->adv_complete.reason, event->connect.status); NRF_LOG_INFO("reason=%d; status=%0X", event->adv_complete.reason, event->connect.status);
if (bleController.IsRadioEnabled() && !bleController.IsConnected()) {
StartAdvertising(); StartAdvertising();
}
break; break;
case BLE_GAP_EVENT_CONNECT: case BLE_GAP_EVENT_CONNECT:
@ -225,11 +220,9 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
currentTimeClient.Reset(); currentTimeClient.Reset();
alertNotificationClient.Reset(); alertNotificationClient.Reset();
connectionHandle = BLE_HS_CONN_HANDLE_NONE; connectionHandle = BLE_HS_CONN_HANDLE_NONE;
if (bleController.IsConnected()) {
bleController.Disconnect(); bleController.Disconnect();
fastAdvCount = 0; fastAdvCount = 0;
StartAdvertising(); StartAdvertising();
}
break; break;
case BLE_GAP_EVENT_CONN_UPDATE: case BLE_GAP_EVENT_CONN_UPDATE:
@ -285,28 +278,7 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
if (event->passkey.params.action == BLE_SM_IOACT_DISP) { if (event->passkey.params.action == BLE_SM_IOACT_DISP) {
struct ble_sm_io pkey = {0}; struct ble_sm_io pkey = {0};
pkey.action = event->passkey.params.action; pkey.action = event->passkey.params.action;
pkey.passkey = ble_ll_rand() % 1000000;
/*
* Passkey is a 6 digits code (1'000'000 possibilities).
* It is important every possible value has an equal probability
* of getting generated. Simply applying a modulo creates a bias
* since 2^32 is not a multiple of 1'000'000.
* To prevent that, we can reject values greater than 999'999.
*
* Rejecting values would happen a lot since 2^32-1 is way greater
* than 1'000'000. An optimisation is to use a multiple of 1'000'000.
* The greatest multiple of 1'000'000 lesser than 2^32-1 is
* 4'294'000'000.
*
* Great explanation at:
* https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/
*/
uint32_t passkey_rand;
do {
passkey_rand = ble_ll_rand();
} while (passkey_rand > 4293999999);
pkey.passkey = passkey_rand % 1000000;
bleController.SetPairingKey(pkey.passkey); bleController.SetPairingKey(pkey.passkey);
systemTask.PushMessage(Pinetime::System::Messages::OnPairing); systemTask.PushMessage(Pinetime::System::Messages::OnPairing);
ble_sm_inject_io(event->passkey.conn_handle, &pkey); ble_sm_inject_io(event->passkey.conn_handle, &pkey);
@ -404,23 +376,6 @@ void NimbleController::NotifyBatteryLevel(uint8_t level) {
} }
} }
void NimbleController::EnableRadio() {
bleController.EnableRadio();
bleController.Disconnect();
fastAdvCount = 0;
StartAdvertising();
}
void NimbleController::DisableRadio() {
bleController.DisableRadio();
if (bleController.IsConnected()) {
ble_gap_terminate(connectionHandle, BLE_ERR_REM_USER_CONN_TERM);
bleController.Disconnect();
} else {
ble_gap_adv_stop();
}
}
void NimbleController::PersistBond(struct ble_gap_conn_desc& desc) { void NimbleController::PersistBond(struct ble_gap_conn_desc& desc) {
union ble_store_key key; union ble_store_key key;
union ble_store_value our_sec, peer_sec, peer_cccd_set[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)] = {0}; union ble_store_value our_sec, peer_sec, peer_cccd_set[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)] = {0};

View File

@ -14,16 +14,15 @@
#include "components/ble/CurrentTimeService.h" #include "components/ble/CurrentTimeService.h"
#include "components/ble/DeviceInformationService.h" #include "components/ble/DeviceInformationService.h"
#include "components/ble/DfuService.h" #include "components/ble/DfuService.h"
#include "components/ble/FSService.h"
#include "components/ble/HeartRateService.h" #include "components/ble/HeartRateService.h"
#include "components/ble/ImmediateAlertService.h" #include "components/ble/ImmediateAlertService.h"
#include "components/ble/MusicService.h" #include "components/ble/MusicService.h"
#include "components/ble/NavigationService.h" #include "components/ble/NavigationService.h"
#include "components/ble/ServiceDiscovery.h" #include "components/ble/ServiceDiscovery.h"
#include "components/ble/MotionService.h" #include "components/ble/MotionService.h"
#include "components/ble/AgendaService.h"
#include "components/ble/weather/WeatherService.h" #include "components/ble/weather/WeatherService.h"
#include "components/fs/FS.h" #include "components/fs/FS.h"
#include "components/ble/FSService.h"
namespace Pinetime { namespace Pinetime {
namespace Drivers { namespace Drivers {
@ -43,17 +42,27 @@ namespace Pinetime {
public: public:
NimbleController(Pinetime::System::SystemTask& systemTask, NimbleController(Pinetime::System::SystemTask& systemTask,
Ble& bleController, Pinetime::Controllers::Ble& bleController,
DateTime& dateTimeController, DateTime& dateTimeController,
NotificationManager& notificationManager, Pinetime::Controllers::NotificationManager& notificationManager,
Battery& batteryController, Controllers::Battery& batteryController,
Pinetime::Drivers::SpiNorFlash& spiNorFlash, Pinetime::Drivers::SpiNorFlash& spiNorFlash,
HeartRateController& heartRateController, Controllers::HeartRateController& heartRateController,
MotionController& motionController, Controllers::MotionController& motionController,
FS& fs); Pinetime::Controllers::FS& fs);
void Init(); void Init();
void StartAdvertising(); void StartAdvertising();
int OnGAPEvent(ble_gap_event* event); int OnGAPEvent(ble_gap_event* event);
int OnDiscoveryEvent(uint16_t i, const ble_gatt_error* pError, const ble_gatt_svc* pSvc);
int OnCTSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error* error, const ble_gatt_chr* characteristic);
int OnANSCharacteristicDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error* error, const ble_gatt_chr* characteristic);
int OnCurrentTimeReadResult(uint16_t connectionHandle, const ble_gatt_error* error, ble_gatt_attr* attribute);
int OnANSDescriptorDiscoveryEventCallback(uint16_t connectionHandle,
const ble_gatt_error* error,
uint16_t characteristicValueHandle,
const ble_gatt_dsc* descriptor);
void StartDiscovery(); void StartDiscovery();
Pinetime::Controllers::MusicService& music() { Pinetime::Controllers::MusicService& music() {
@ -62,9 +71,6 @@ namespace Pinetime {
Pinetime::Controllers::NavigationService& navigation() { Pinetime::Controllers::NavigationService& navigation() {
return navService; return navService;
}; };
Pinetime::Controllers::AgendaService& agenda() {
return agendaService;
};
Pinetime::Controllers::AlertNotificationService& alertService() { Pinetime::Controllers::AlertNotificationService& alertService() {
return anService; return anService;
}; };
@ -77,10 +83,7 @@ namespace Pinetime {
void RestartFastAdv() { void RestartFastAdv() {
fastAdvCount = 0; fastAdvCount = 0;
}; }
void EnableRadio();
void DisableRadio();
private: private:
void PersistBond(struct ble_gap_conn_desc& desc); void PersistBond(struct ble_gap_conn_desc& desc);
@ -88,11 +91,12 @@ namespace Pinetime {
static constexpr const char* deviceName = "InfiniTime"; static constexpr const char* deviceName = "InfiniTime";
Pinetime::System::SystemTask& systemTask; Pinetime::System::SystemTask& systemTask;
Ble& bleController; Pinetime::Controllers::Ble& bleController;
DateTime& dateTimeController; DateTime& dateTimeController;
Pinetime::Controllers::NotificationManager& notificationManager;
Pinetime::Drivers::SpiNorFlash& spiNorFlash; Pinetime::Drivers::SpiNorFlash& spiNorFlash;
FS& fs; Pinetime::Controllers::FS& fs;
DfuService dfuService; Pinetime::Controllers::DfuService dfuService;
DeviceInformationService deviceInformationService; DeviceInformationService deviceInformationService;
CurrentTimeClient currentTimeClient; CurrentTimeClient currentTimeClient;
@ -107,7 +111,6 @@ namespace Pinetime {
HeartRateService heartRateService; HeartRateService heartRateService;
MotionService motionService; MotionService motionService;
FSService fsService; FSService fsService;
AgendaService agendaService;
ServiceDiscovery serviceDiscovery; ServiceDiscovery serviceDiscovery;
uint8_t addrType; uint8_t addrType;

View File

@ -127,8 +127,7 @@ namespace Pinetime {
{.uuid = &weatherControlCharUuid.u, .access_cb = WeatherCallback, .arg = this, .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ}, {.uuid = &weatherControlCharUuid.u, .access_cb = WeatherCallback, .arg = this, .flags = BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ},
{nullptr}}; {nullptr}};
const struct ble_gatt_svc_def serviceDefinition[2] = { const struct ble_gatt_svc_def serviceDefinition[2] = {
{.type = BLE_GATT_SVC_TYPE_PRIMARY, .uuid = &weatherUuid.u, .characteristics = characteristicDefinition}, {.type = BLE_GATT_SVC_TYPE_PRIMARY, .uuid = &weatherUuid.u, .characteristics = characteristicDefinition}, {0}};
{0}};
uint16_t eventHandle {}; uint16_t eventHandle {};

View File

@ -11,22 +11,13 @@ namespace {
char const* MonthsStringLow[] = {"--", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; char const* MonthsStringLow[] = {"--", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
} }
DateTime::DateTime(Controllers::Settings& settingsController) : settingsController {settingsController} {
}
void DateTime::SetCurrentTime(std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> t) { void DateTime::SetCurrentTime(std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> t) {
this->currentDateTime = t; this->currentDateTime = t;
UpdateTime(previousSystickCounter); // Update internal state without updating the time UpdateTime(previousSystickCounter); // Update internal state without updating the time
} }
void DateTime::SetTime(uint16_t year, void DateTime::SetTime(
uint8_t month, uint16_t year, uint8_t month, uint8_t day, uint8_t dayOfWeek, uint8_t hour, uint8_t minute, uint8_t second, uint32_t systickCounter) {
uint8_t day,
uint8_t dayOfWeek,
uint8_t hour,
uint8_t minute,
uint8_t second,
uint32_t systickCounter) {
std::tm tm = { std::tm tm = {
/* .tm_sec = */ second, /* .tm_sec = */ second,
/* .tm_min = */ minute, /* .tm_min = */ minute,
@ -45,8 +36,6 @@ void DateTime::SetTime(uint16_t year,
UpdateTime(systickCounter); UpdateTime(systickCounter);
NRF_LOG_INFO("* %d %d %d ", this->hour, this->minute, this->second); NRF_LOG_INFO("* %d %d %d ", this->hour, this->minute, this->second);
NRF_LOG_INFO("* %d %d %d ", this->day, this->month, this->year); NRF_LOG_INFO("* %d %d %d ", this->day, this->month, this->year);
systemTask->PushMessage(System::Messages::OnNewTime);
} }
void DateTime::UpdateTime(uint32_t systickCounter) { void DateTime::UpdateTime(uint32_t systickCounter) {
@ -86,24 +75,6 @@ void DateTime::UpdateTime(uint32_t systickCounter) {
minute = time.minutes().count(); minute = time.minutes().count();
second = time.seconds().count(); second = time.seconds().count();
if (minute == 0 && !isHourAlreadyNotified) {
isHourAlreadyNotified = true;
if (systemTask != nullptr) {
systemTask->PushMessage(System::Messages::OnNewHour);
}
} else if (minute != 0) {
isHourAlreadyNotified = false;
}
if ((minute == 0 || minute == 30) && !isHalfHourAlreadyNotified) {
isHalfHourAlreadyNotified = true;
if (systemTask != nullptr) {
systemTask->PushMessage(System::Messages::OnNewHalfHour);
}
} else if (minute != 0 && minute != 30) {
isHalfHourAlreadyNotified = false;
}
// Notify new day to SystemTask // Notify new day to SystemTask
if (hour == 0 and not isMidnightAlreadyNotified) { if (hour == 0 and not isMidnightAlreadyNotified) {
isMidnightAlreadyNotified = true; isMidnightAlreadyNotified = true;
@ -114,11 +85,11 @@ void DateTime::UpdateTime(uint32_t systickCounter) {
} }
} }
const char* DateTime::MonthShortToString() const { const char* DateTime::MonthShortToString() {
return MonthsString[static_cast<uint8_t>(month)]; return MonthsString[static_cast<uint8_t>(month)];
} }
const char* DateTime::DayOfWeekShortToString() const { const char* DateTime::DayOfWeekShortToString() {
return DaysStringShort[static_cast<uint8_t>(dayOfWeek)]; return DaysStringShort[static_cast<uint8_t>(dayOfWeek)];
} }
@ -130,23 +101,3 @@ void DateTime::Register(Pinetime::System::SystemTask* systemTask) {
this->systemTask = systemTask; this->systemTask = systemTask;
} }
using ClockType = Pinetime::Controllers::Settings::ClockType;
std::string DateTime::FormattedTime() {
// Return time as a string in 12- or 24-hour format
char buff[9];
if (settingsController.GetClockType() == ClockType::H12) {
uint8_t hour12;
const char* amPmStr;
if (hour < 12) {
hour12 = (hour == 0) ? 12 : hour;
amPmStr = "AM";
} else {
hour12 = (hour == 12) ? 12 : hour - 12;
amPmStr = "PM";
}
sprintf(buff, "%i:%02i %s", hour12, minute, amPmStr);
} else {
sprintf(buff, "%02i:%02i", hour, minute);
}
return std::string(buff);
}

View File

@ -2,8 +2,6 @@
#include <cstdint> #include <cstdint>
#include <chrono> #include <chrono>
#include <string>
#include "components/settings/Settings.h"
namespace Pinetime { namespace Pinetime {
namespace System { namespace System {
@ -12,7 +10,6 @@ namespace Pinetime {
namespace Controllers { namespace Controllers {
class DateTime { class DateTime {
public: public:
DateTime(Controllers::Settings& settingsController);
enum class Days : uint8_t { Unknown, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }; enum class Days : uint8_t { Unknown, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday };
enum class Months : uint8_t { enum class Months : uint8_t {
Unknown, Unknown,
@ -61,8 +58,8 @@ namespace Pinetime {
return second; return second;
} }
const char* MonthShortToString() const; const char* MonthShortToString();
const char* DayOfWeekShortToString() const; const char* DayOfWeekShortToString();
static const char* MonthShortToStringLow(Months month); static const char* MonthShortToStringLow(Months month);
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> CurrentDateTime() const { std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> CurrentDateTime() const {
@ -74,7 +71,6 @@ namespace Pinetime {
void Register(System::SystemTask* systemTask); void Register(System::SystemTask* systemTask);
void SetCurrentTime(std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> t); void SetCurrentTime(std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> t);
std::string FormattedTime();
private: private:
uint16_t year = 0; uint16_t year = 0;
@ -90,10 +86,7 @@ namespace Pinetime {
std::chrono::seconds uptime {0}; std::chrono::seconds uptime {0};
bool isMidnightAlreadyNotified = false; bool isMidnightAlreadyNotified = false;
bool isHourAlreadyNotified = true;
bool isHalfHourAlreadyNotified = true;
System::SystemTask* systemTask = nullptr; System::SystemTask* systemTask = nullptr;
Controllers::Settings& settingsController;
}; };
} }
} }

View File

@ -1,8 +1,6 @@
#pragma once #pragma once
#include <array> #include <array>
#include <cstddef>
#include <cstdint>
#include "components/heartrate/Biquad.h" #include "components/heartrate/Biquad.h"
#include "components/heartrate/Ptagc.h" #include "components/heartrate/Ptagc.h"

View File

@ -1,5 +1,5 @@
#include "components/motion/MotionController.h" #include "components/motion/MotionController.h"
#include "os/os_cputime.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
void MotionController::Update(int16_t x, int16_t y, int16_t z, uint32_t nbSteps) { void MotionController::Update(int16_t x, int16_t y, int16_t z, uint32_t nbSteps) {
@ -21,7 +21,7 @@ void MotionController::Update(int16_t x, int16_t y, int16_t z, uint32_t nbSteps)
} }
} }
bool MotionController::Should_RaiseWake(bool isSleeping) { bool MotionController::ShouldWakeUp(bool isSleeping) {
if ((x + 335) <= 670 && z < 0) { if ((x + 335) <= 670 && z < 0) {
if (not isSleeping) { if (not isSleeping) {
if (y <= 0) { if (y <= 0) {
@ -43,29 +43,6 @@ bool MotionController::Should_RaiseWake(bool isSleeping) {
} }
return false; return false;
} }
bool MotionController::Should_ShakeWake(uint16_t thresh) {
bool wake = false;
auto diff = xTaskGetTickCount() - lastShakeTime;
lastShakeTime = xTaskGetTickCount();
/* Currently Polling at 10hz, If this ever goes faster scalar and EMA might need adjusting */
int32_t speed = std::abs(z + (y / 2) + (x / 4) - lastYForShake - lastZForShake) / diff * 100;
//(.2 * speed) + ((1 - .2) * accumulatedspeed);
// implemented without floats as .25Alpha
accumulatedspeed = (speed / 5) + ((accumulatedspeed / 5) * 4);
if (accumulatedspeed > thresh) {
wake = true;
}
lastXForShake = x / 4;
lastYForShake = y / 2;
lastZForShake = z;
return wake;
}
int32_t MotionController::currentShakeSpeed() {
return accumulatedspeed;
}
void MotionController::IsSensorOk(bool isOk) { void MotionController::IsSensorOk(bool isOk) {
isSensorOk = isOk; isSensorOk = isOk;
} }

View File

@ -35,10 +35,8 @@ namespace Pinetime {
uint32_t GetTripSteps() const { uint32_t GetTripSteps() const {
return currentTripSteps; return currentTripSteps;
} }
bool ShouldWakeUp(bool isSleeping);
bool Should_ShakeWake(uint16_t thresh);
bool Should_RaiseWake(bool isSleeping);
int32_t currentShakeSpeed();
void IsSensorOk(bool isOk); void IsSensorOk(bool isOk);
bool IsSensorOk() const { bool IsSensorOk() const {
return isSensorOk; return isSensorOk;
@ -61,12 +59,6 @@ namespace Pinetime {
bool isSensorOk = false; bool isSensorOk = false;
DeviceTypes deviceType = DeviceTypes::Unknown; DeviceTypes deviceType = DeviceTypes::Unknown;
Pinetime::Controllers::MotionService* service = nullptr; Pinetime::Controllers::MotionService* service = nullptr;
int16_t lastXForShake = 0;
int16_t lastYForShake = 0;
int16_t lastZForShake = 0;
int32_t accumulatedspeed = 0;
uint32_t lastShakeTime = 0;
}; };
} }
} }

View File

@ -1,39 +1,43 @@
#include "components/motor/MotorController.h" #include "components/motor/MotorController.h"
#include <hal/nrf_gpio.h> #include <hal/nrf_gpio.h>
#include "systemtask/SystemTask.h" #include "systemtask/SystemTask.h"
#include "app_timer.h"
#include "drivers/PinMap.h" #include "drivers/PinMap.h"
APP_TIMER_DEF(shortVibTimer);
APP_TIMER_DEF(longVibTimer);
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
void MotorController::Init() { void MotorController::Init() {
nrf_gpio_cfg_output(PinMap::Motor); nrf_gpio_cfg_output(PinMap::Motor);
nrf_gpio_pin_set(PinMap::Motor); nrf_gpio_pin_set(PinMap::Motor);
app_timer_init();
shortVib = xTimerCreate("shortVib", 1, pdFALSE, nullptr, StopMotor); app_timer_create(&shortVibTimer, APP_TIMER_MODE_SINGLE_SHOT, StopMotor);
longVib = xTimerCreate("longVib", pdMS_TO_TICKS(1000), pdTRUE, this, Ring); app_timer_create(&longVibTimer, APP_TIMER_MODE_REPEATED, Ring);
} }
void MotorController::Ring(TimerHandle_t xTimer) { void MotorController::Ring(void* p_context) {
auto* motorController = static_cast<MotorController*>(pvTimerGetTimerID(xTimer)); auto* motorController = static_cast<MotorController*>(p_context);
motorController->RunForDuration(50); motorController->RunForDuration(50);
} }
void MotorController::RunForDuration(uint8_t motorDuration) { void MotorController::RunForDuration(uint8_t motorDuration) {
if (xTimerChangePeriod(shortVib, pdMS_TO_TICKS(motorDuration), 0) == pdPASS && xTimerStart(shortVib, 0) == pdPASS) {
nrf_gpio_pin_clear(PinMap::Motor); nrf_gpio_pin_clear(PinMap::Motor);
} app_timer_start(shortVibTimer, APP_TIMER_TICKS(motorDuration), nullptr);
} }
void MotorController::StartRinging() { void MotorController::StartRinging() {
RunForDuration(50); Ring(this);
xTimerStart(longVib, 0); app_timer_start(longVibTimer, APP_TIMER_TICKS(1000), this);
} }
void MotorController::StopRinging() { void MotorController::StopRinging() {
xTimerStop(longVib, 0); app_timer_stop(longVibTimer);
nrf_gpio_pin_set(PinMap::Motor); nrf_gpio_pin_set(PinMap::Motor);
} }
void MotorController::StopMotor(TimerHandle_t xTimer) { void MotorController::StopMotor(void* p_context) {
nrf_gpio_pin_set(PinMap::Motor); nrf_gpio_pin_set(PinMap::Motor);
} }

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <FreeRTOS.h>
#include <timers.h>
#include <cstdint> #include <cstdint>
namespace Pinetime { namespace Pinetime {
@ -14,13 +12,11 @@ namespace Pinetime {
void Init(); void Init();
void RunForDuration(uint8_t motorDuration); void RunForDuration(uint8_t motorDuration);
void StartRinging(); void StartRinging();
void StopRinging(); static void StopRinging();
private: private:
static void Ring(TimerHandle_t xTimer); static void Ring(void* p_context);
static void StopMotor(TimerHandle_t xTimer); static void StopMotor(void* p_context);
TimerHandle_t shortVib;
TimerHandle_t longVib;
}; };
} }
} }

View File

@ -26,7 +26,7 @@ void Settings::LoadSettingsFromFile() {
SettingsData bufferSettings; SettingsData bufferSettings;
lfs_file_t settingsFile; lfs_file_t settingsFile;
if (fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_RDONLY) != LFS_ERR_OK) { if ( fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_RDWR | LFS_O_CREAT) != LFS_ERR_OK) {
return; return;
} }
fs.FileRead(&settingsFile, reinterpret_cast<uint8_t*>(&bufferSettings), sizeof(settings)); fs.FileRead(&settingsFile, reinterpret_cast<uint8_t*>(&bufferSettings), sizeof(settings));
@ -39,7 +39,7 @@ void Settings::LoadSettingsFromFile() {
void Settings::SaveSettingsToFile() { void Settings::SaveSettingsToFile() {
lfs_file_t settingsFile; lfs_file_t settingsFile;
if (fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_WRONLY | LFS_O_CREAT) != LFS_ERR_OK) { if ( fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_RDWR | LFS_O_CREAT) != LFS_ERR_OK) {
return; return;
} }
fs.FileWrite(&settingsFile, reinterpret_cast<uint8_t*>(&settings), sizeof(settings)); fs.FileWrite(&settingsFile, reinterpret_cast<uint8_t*>(&settings), sizeof(settings));

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <cstdint> #include <cstdint>
#include <bitset> #include <bitset>
#include "components/datetime/DateTimeController.h"
#include "components/brightness/BrightnessController.h" #include "components/brightness/BrightnessController.h"
#include "components/fs/FS.h" #include "components/fs/FS.h"
@ -10,31 +11,13 @@ namespace Pinetime {
public: public:
enum class ClockType : uint8_t { H24, H12 }; enum class ClockType : uint8_t { H24, H12 };
enum class Notification : uint8_t { ON, OFF }; enum class Notification : uint8_t { ON, OFF };
enum class ChimesOption : uint8_t { None, Hours, HalfHours };
enum class WakeUpMode : uint8_t { enum class WakeUpMode : uint8_t {
SingleTap = 0, SingleTap = 0,
DoubleTap = 1, DoubleTap = 1,
RaiseWrist = 2, RaiseWrist = 2,
Shake = 3,
}; };
enum class Colors : uint8_t { enum class Colors : uint8_t {
White, White, Silver, Gray, Black, Red, Maroon, Yellow, Olive, Lime, Green, Cyan, Teal, Blue, Navy, Magenta, Purple, Orange
Silver,
Gray,
Black,
Red,
Maroon,
Yellow,
Olive,
Lime,
Green,
Cyan,
Teal,
Blue,
Navy,
Magenta,
Purple,
Orange
}; };
struct PineTimeStyle { struct PineTimeStyle {
Colors ColorTime = Colors::Teal; Colors ColorTime = Colors::Teal;
@ -57,16 +40,6 @@ namespace Pinetime {
return settings.clockFace; return settings.clockFace;
}; };
void SetChimeOption(ChimesOption chimeOption) {
if (chimeOption != settings.chimesOption) {
settingsChanged = true;
}
settings.chimesOption = chimeOption;
};
ChimesOption GetChimeOption() const {
return settings.chimesOption;
};
void SetPTSColorTime(Colors colorTime) { void SetPTSColorTime(Colors colorTime) {
if (colorTime != settings.PTS.ColorTime) if (colorTime != settings.PTS.ColorTime)
settingsChanged = true; settingsChanged = true;
@ -135,22 +108,10 @@ namespace Pinetime {
} }
settings.screenTimeOut = timeout; settings.screenTimeOut = timeout;
}; };
uint32_t GetScreenTimeOut() const { uint32_t GetScreenTimeOut() const {
return settings.screenTimeOut; return settings.screenTimeOut;
}; };
void SetShakeThreshold(uint16_t thresh) {
if (settings.shakeWakeThreshold != thresh) {
settings.shakeWakeThreshold = thresh;
settingsChanged = true;
}
}
int16_t GetShakeThreshold() const {
return settings.shakeWakeThreshold;
}
void setWakeUpMode(WakeUpMode wakeUp, bool enabled) { void setWakeUpMode(WakeUpMode wakeUp, bool enabled) {
if (enabled != isWakeUpModeOn(wakeUp)) { if (enabled != isWakeUpModeOn(wakeUp)) {
settingsChanged = true; settingsChanged = true;
@ -165,13 +126,13 @@ namespace Pinetime {
case WakeUpMode::DoubleTap: case WakeUpMode::DoubleTap:
settings.wakeUpMode.set(static_cast<size_t>(WakeUpMode::SingleTap), false); settings.wakeUpMode.set(static_cast<size_t>(WakeUpMode::SingleTap), false);
break; break;
default: case WakeUpMode::RaiseWrist:
break; break;
} }
} }
}; };
std::bitset<4> getWakeUpModes() const { std::bitset<3> getWakeUpModes() const {
return settings.wakeUpMode; return settings.wakeUpMode;
} }
@ -185,7 +146,6 @@ namespace Pinetime {
} }
settings.brightLevel = level; settings.brightLevel = level;
}; };
Controllers::BrightnessController::Levels GetBrightness() const { Controllers::BrightnessController::Levels GetBrightness() const {
return settings.brightLevel; return settings.brightLevel;
}; };
@ -197,22 +157,12 @@ namespace Pinetime {
settings.stepsGoal = goal; settings.stepsGoal = goal;
}; };
uint32_t GetStepsGoal() const { uint32_t GetStepsGoal() const { return settings.stepsGoal; };
return settings.stepsGoal;
};
void SetBleRadioEnabled(bool enabled) {
bleRadioEnabled = enabled;
};
bool GetBleRadioEnabled() const {
return bleRadioEnabled;
};
private: private:
Pinetime::Controllers::FS& fs; Pinetime::Controllers::FS& fs;
static constexpr uint32_t settingsVersion = 0x0003; static constexpr uint32_t settingsVersion = 0x0002;
struct SettingsData { struct SettingsData {
uint32_t version = settingsVersion; uint32_t version = settingsVersion;
uint32_t stepsGoal = 10000; uint32_t stepsGoal = 10000;
@ -222,12 +172,11 @@ namespace Pinetime {
Notification notificationStatus = Notification::ON; Notification notificationStatus = Notification::ON;
uint8_t clockFace = 0; uint8_t clockFace = 0;
ChimesOption chimesOption = ChimesOption::None;
PineTimeStyle PTS; PineTimeStyle PTS;
std::bitset<4> wakeUpMode {0}; std::bitset<3> wakeUpMode {0};
uint16_t shakeWakeThreshold = 150;
Controllers::BrightnessController::Levels brightLevel = Controllers::BrightnessController::Levels::Medium; Controllers::BrightnessController::Levels brightLevel = Controllers::BrightnessController::Levels::Medium;
}; };
@ -236,10 +185,6 @@ namespace Pinetime {
uint8_t appMenu = 0; uint8_t appMenu = 0;
uint8_t settingsMenu = 0; uint8_t settingsMenu = 0;
/* ble state is intentionally not saved with the other watch settings and initialized
* to off (false) on every boot because we always want ble to be enabled on startup
*/
bool bleRadioEnabled = true;
void LoadSettingsFromFile(); void LoadSettingsFromFile();
void SaveSettingsToFile(); void SaveSettingsToFile();

View File

@ -1,39 +1,69 @@
//
// Created by florian on 16.05.21.
//
#include "components/timer/TimerController.h" #include "components/timer/TimerController.h"
#include "systemtask/SystemTask.h" #include "systemtask/SystemTask.h"
#include "app_timer.h"
#include "task.h"
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
void TimerCallback(TimerHandle_t xTimer) {
auto* controller = static_cast<TimerController*>(pvTimerGetTimerID(xTimer)); APP_TIMER_DEF(timerAppTimer);
namespace {
void TimerEnd(void* p_context) {
auto* controller = static_cast<Pinetime::Controllers::TimerController*> (p_context);
if(controller != nullptr)
controller->OnTimerEnd(); controller->OnTimerEnd();
} }
}
void TimerController::Init(Pinetime::System::SystemTask* systemTask) {
this->systemTask = systemTask; void TimerController::Init() {
timer = xTimerCreate("Timer", 1, pdFALSE, this, TimerCallback); app_timer_create(&timerAppTimer, APP_TIMER_MODE_SINGLE_SHOT, TimerEnd);
} }
void TimerController::StartTimer(uint32_t duration) { void TimerController::StartTimer(uint32_t duration) {
xTimerChangePeriod(timer, pdMS_TO_TICKS(duration), 0); app_timer_stop(timerAppTimer);
xTimerStart(timer, 0); auto currentTicks = xTaskGetTickCount();
app_timer_start(timerAppTimer, APP_TIMER_TICKS(duration), this);
endTicks = currentTicks + APP_TIMER_TICKS(duration);
timerRunning = true;
} }
uint32_t TimerController::GetTimeRemaining() { uint32_t TimerController::GetTimeRemaining() {
if (IsRunning()) { if (!timerRunning) {
TickType_t remainingTime = xTimerGetExpiryTime(timer) - xTaskGetTickCount();
return (remainingTime * 1000 / configTICK_RATE_HZ);
}
return 0; return 0;
} }
auto currentTicks = xTaskGetTickCount();
TickType_t deltaTicks = 0;
if (currentTicks > endTicks) {
deltaTicks = 0xffffffff - currentTicks;
deltaTicks += (endTicks + 1);
} else {
deltaTicks = endTicks - currentTicks;
}
return (static_cast<TickType_t>(deltaTicks) / static_cast<TickType_t>(configTICK_RATE_HZ)) * 1000;
}
void TimerController::StopTimer() { void TimerController::StopTimer() {
xTimerStop(timer, 0); app_timer_stop(timerAppTimer);
timerRunning = false;
} }
bool TimerController::IsRunning() { bool TimerController::IsRunning() {
return (xTimerIsTimerActive(timer) == pdTRUE); return timerRunning;
} }
void TimerController::OnTimerEnd() { void TimerController::OnTimerEnd() {
timerRunning = false;
if(systemTask != nullptr)
systemTask->PushMessage(System::Messages::OnTimerDone); systemTask->PushMessage(System::Messages::OnTimerDone);
} }
void TimerController::Register(Pinetime::System::SystemTask* systemTask) {
this->systemTask = systemTask;
}

View File

@ -1,7 +1,8 @@
#pragma once #pragma once
#include <FreeRTOS.h> #include <cstdint>
#include <timers.h> #include "app_timer.h"
#include "portmacro_cmsis.h"
namespace Pinetime { namespace Pinetime {
namespace System { namespace System {
@ -13,7 +14,7 @@ namespace Pinetime {
public: public:
TimerController() = default; TimerController() = default;
void Init(System::SystemTask* systemTask); void Init();
void StartTimer(uint32_t duration); void StartTimer(uint32_t duration);
@ -25,9 +26,12 @@ namespace Pinetime {
void OnTimerEnd(); void OnTimerEnd();
void Register(System::SystemTask* systemTask);
private: private:
System::SystemTask* systemTask = nullptr; System::SystemTask* systemTask = nullptr;
TimerHandle_t timer; TickType_t endTicks;
bool timerRunning = false;
}; };
} }
} }

View File

@ -36,12 +36,7 @@ namespace Pinetime {
SettingSteps, SettingSteps,
SettingSetDate, SettingSetDate,
SettingSetTime, SettingSetTime,
SettingChimes,
SettingShakeThreshold,
SettingBluetooth,
Error, Error,
// oli: custom
Agenda
}; };
} }
} }

View File

@ -5,41 +5,23 @@ using namespace Pinetime::Controllers;
lv_color_t Pinetime::Applications::Convert(Pinetime::Controllers::Settings::Colors color) { lv_color_t Pinetime::Applications::Convert(Pinetime::Controllers::Settings::Colors color) {
switch (color) { switch (color) {
case Pinetime::Controllers::Settings::Colors::White: case Pinetime::Controllers::Settings::Colors::White: return LV_COLOR_WHITE;
return LV_COLOR_WHITE; case Pinetime::Controllers::Settings::Colors::Silver: return LV_COLOR_SILVER;
case Pinetime::Controllers::Settings::Colors::Silver: case Pinetime::Controllers::Settings::Colors::Gray: return LV_COLOR_GRAY;
return LV_COLOR_SILVER; case Pinetime::Controllers::Settings::Colors::Black: return LV_COLOR_BLACK;
case Pinetime::Controllers::Settings::Colors::Gray: case Pinetime::Controllers::Settings::Colors::Red: return LV_COLOR_RED;
return LV_COLOR_GRAY; case Pinetime::Controllers::Settings::Colors::Maroon: return LV_COLOR_MAROON;
case Pinetime::Controllers::Settings::Colors::Black: case Pinetime::Controllers::Settings::Colors::Yellow: return LV_COLOR_YELLOW;
return LV_COLOR_BLACK; case Pinetime::Controllers::Settings::Colors::Olive: return LV_COLOR_OLIVE;
case Pinetime::Controllers::Settings::Colors::Red: case Pinetime::Controllers::Settings::Colors::Lime: return LV_COLOR_LIME;
return LV_COLOR_RED; case Pinetime::Controllers::Settings::Colors::Green: return LV_COLOR_GREEN;
case Pinetime::Controllers::Settings::Colors::Maroon: case Pinetime::Controllers::Settings::Colors::Cyan: return LV_COLOR_CYAN;
return LV_COLOR_MAKE(0xb0, 0x0, 0x0); case Pinetime::Controllers::Settings::Colors::Teal: return LV_COLOR_TEAL;
case Pinetime::Controllers::Settings::Colors::Yellow: case Pinetime::Controllers::Settings::Colors::Blue: return LV_COLOR_BLUE;
return LV_COLOR_YELLOW; case Pinetime::Controllers::Settings::Colors::Navy: return LV_COLOR_NAVY;
case Pinetime::Controllers::Settings::Colors::Olive: case Pinetime::Controllers::Settings::Colors::Magenta: return LV_COLOR_MAGENTA;
return LV_COLOR_MAKE(0xb0, 0xb0, 0x0); case Pinetime::Controllers::Settings::Colors::Purple: return LV_COLOR_PURPLE;
case Pinetime::Controllers::Settings::Colors::Lime: case Pinetime::Controllers::Settings::Colors::Orange: return LV_COLOR_ORANGE;
return LV_COLOR_LIME; default: return LV_COLOR_WHITE;
case Pinetime::Controllers::Settings::Colors::Green:
return LV_COLOR_MAKE(0x0, 0xb0, 0x0);
case Pinetime::Controllers::Settings::Colors::Cyan:
return LV_COLOR_CYAN;
case Pinetime::Controllers::Settings::Colors::Teal:
return LV_COLOR_MAKE(0x0, 0xb0, 0xb0);
case Pinetime::Controllers::Settings::Colors::Blue:
return LV_COLOR_BLUE;
case Pinetime::Controllers::Settings::Colors::Navy:
return LV_COLOR_MAKE(0x0, 0x0, 0xb0);
case Pinetime::Controllers::Settings::Colors::Magenta:
return LV_COLOR_MAGENTA;
case Pinetime::Controllers::Settings::Colors::Purple:
return LV_COLOR_MAKE(0xb0, 0x0, 0xb0);
case Pinetime::Controllers::Settings::Colors::Orange:
return LV_COLOR_ORANGE;
default:
return LV_COLOR_WHITE;
} }
} }

View File

@ -11,12 +11,14 @@
#include "components/motion/MotionController.h" #include "components/motion/MotionController.h"
#include "components/motor/MotorController.h" #include "components/motor/MotorController.h"
#include "displayapp/screens/ApplicationList.h" #include "displayapp/screens/ApplicationList.h"
#include "displayapp/screens/Brightness.h"
#include "displayapp/screens/Clock.h" #include "displayapp/screens/Clock.h"
#include "displayapp/screens/FirmwareUpdate.h" #include "displayapp/screens/FirmwareUpdate.h"
#include "displayapp/screens/FirmwareValidation.h" #include "displayapp/screens/FirmwareValidation.h"
#include "displayapp/screens/InfiniPaint.h" #include "displayapp/screens/InfiniPaint.h"
#include "displayapp/screens/Paddle.h" #include "displayapp/screens/Paddle.h"
#include "displayapp/screens/StopWatch.h" #include "displayapp/screens/StopWatch.h"
#include "displayapp/screens/Meter.h"
#include "displayapp/screens/Metronome.h" #include "displayapp/screens/Metronome.h"
#include "displayapp/screens/Music.h" #include "displayapp/screens/Music.h"
#include "displayapp/screens/Navigation.h" #include "displayapp/screens/Navigation.h"
@ -30,8 +32,6 @@
#include "displayapp/screens/PassKey.h" #include "displayapp/screens/PassKey.h"
#include "displayapp/screens/Error.h" #include "displayapp/screens/Error.h"
#include "displayapp/screens/Agenda.h"
#include "drivers/Cst816s.h" #include "drivers/Cst816s.h"
#include "drivers/St7789.h" #include "drivers/St7789.h"
#include "drivers/Watchdog.h" #include "drivers/Watchdog.h"
@ -47,9 +47,6 @@
#include "displayapp/screens/settings/SettingSteps.h" #include "displayapp/screens/settings/SettingSteps.h"
#include "displayapp/screens/settings/SettingSetDate.h" #include "displayapp/screens/settings/SettingSetDate.h"
#include "displayapp/screens/settings/SettingSetTime.h" #include "displayapp/screens/settings/SettingSetTime.h"
#include "displayapp/screens/settings/SettingChimes.h"
#include "displayapp/screens/settings/SettingShakeThreshold.h"
#include "displayapp/screens/settings/SettingBluetooth.h"
#include "libs/lv_conf.h" #include "libs/lv_conf.h"
@ -60,6 +57,28 @@ namespace {
static inline bool in_isr(void) { static inline bool in_isr(void) {
return (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) != 0; return (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) != 0;
} }
TouchEvents ConvertGesture(Pinetime::Drivers::Cst816S::Gestures gesture) {
switch (gesture) {
case Pinetime::Drivers::Cst816S::Gestures::SingleTap:
return TouchEvents::Tap;
case Pinetime::Drivers::Cst816S::Gestures::LongPress:
return TouchEvents::LongTap;
case Pinetime::Drivers::Cst816S::Gestures::DoubleTap:
return TouchEvents::DoubleTap;
case Pinetime::Drivers::Cst816S::Gestures::SlideRight:
return TouchEvents::SwipeRight;
case Pinetime::Drivers::Cst816S::Gestures::SlideLeft:
return TouchEvents::SwipeLeft;
case Pinetime::Drivers::Cst816S::Gestures::SlideDown:
return TouchEvents::SwipeDown;
case Pinetime::Drivers::Cst816S::Gestures::SlideUp:
return TouchEvents::SwipeUp;
case Pinetime::Drivers::Cst816S::Gestures::None:
default:
return TouchEvents::None;
}
}
} }
DisplayApp::DisplayApp(Drivers::St7789& lcd, DisplayApp::DisplayApp(Drivers::St7789& lcd,
@ -76,7 +95,6 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::MotionController& motionController,
Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::TimerController& timerController,
Pinetime::Controllers::AlarmController& alarmController, Pinetime::Controllers::AlarmController& alarmController,
Pinetime::Controllers::BrightnessController& brightnessController,
Pinetime::Controllers::TouchHandler& touchHandler) Pinetime::Controllers::TouchHandler& touchHandler)
: lcd {lcd}, : lcd {lcd},
lvgl {lvgl}, lvgl {lvgl},
@ -92,7 +110,6 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
motionController {motionController}, motionController {motionController},
timerController {timerController}, timerController {timerController},
alarmController {alarmController}, alarmController {alarmController},
brightnessController {brightnessController},
touchHandler {touchHandler} { touchHandler {touchHandler} {
} }
@ -107,7 +124,7 @@ void DisplayApp::Start(System::BootErrors error) {
LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::None); LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::None);
} }
if (pdPASS != xTaskCreate(DisplayApp::Process, "displayapp", 800, this, 0, &taskHandle)) { if (pdPASS != xTaskCreate(DisplayApp::Process, "displayapp", 600, this, 0, &taskHandle)) {
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM); APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
} }
} }
@ -163,10 +180,12 @@ void DisplayApp::Refresh() {
brightnessController.Lower(); brightnessController.Lower();
vTaskDelay(100); vTaskDelay(100);
} }
lcd.DisplayOff();
PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping); PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
state = States::Idle; state = States::Idle;
break; break;
case Messages::GoToRunning: case Messages::GoToRunning:
lcd.DisplayOn();
brightnessController.Restore(); brightnessController.Restore();
state = States::Running; state = States::Running;
break; break;
@ -183,7 +202,7 @@ void DisplayApp::Refresh() {
case Messages::TimerDone: case Messages::TimerDone:
if (currentApp == Apps::Timer) { if (currentApp == Apps::Timer) {
auto* timer = static_cast<Screens::Timer*>(currentScreen.get()); auto* timer = static_cast<Screens::Timer*>(currentScreen.get());
timer->SetDone(); timer->setDone();
} else { } else {
LoadApp(Apps::Timer, DisplayApp::FullRefreshDirections::Down); LoadApp(Apps::Timer, DisplayApp::FullRefreshDirections::Down);
} }
@ -203,7 +222,7 @@ void DisplayApp::Refresh() {
if (state != States::Running) { if (state != States::Running) {
break; break;
} }
auto gesture = touchHandler.GestureGet(); auto gesture = ConvertGesture(touchHandler.GestureGet());
if (gesture == TouchEvents::None) { if (gesture == TouchEvents::None) {
break; break;
} }
@ -269,27 +288,21 @@ void DisplayApp::Refresh() {
case Messages::BleFirmwareUpdateStarted: case Messages::BleFirmwareUpdateStarted:
LoadApp(Apps::FirmwareUpdate, DisplayApp::FullRefreshDirections::Down); LoadApp(Apps::FirmwareUpdate, DisplayApp::FullRefreshDirections::Down);
break; break;
case Messages::BleRadioEnableToggle:
PushMessageToSystemTask(System::Messages::BleRadioEnableToggle);
break;
case Messages::UpdateDateTime: case Messages::UpdateDateTime:
// Added to remove warning // Added to remove warning
// What should happen here? // What should happen here?
break; break;
case Messages::Clock:
LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::None);
break;
} }
} }
if (touchHandler.IsTouching()) {
currentScreen->OnTouchEvent(touchHandler.GetX(), touchHandler.GetY());
}
if (nextApp != Apps::None) { if (nextApp != Apps::None) {
LoadApp(nextApp, nextDirection); LoadApp(nextApp, nextDirection);
nextApp = Apps::None; nextApp = Apps::None;
} }
if (touchHandler.IsTouching()) {
currentScreen->OnTouchEvent(touchHandler.GetX(), touchHandler.GetY());
}
} }
void DisplayApp::StartApp(Apps app, DisplayApp::FullRefreshDirections direction) { void DisplayApp::StartApp(Apps app, DisplayApp::FullRefreshDirections direction) {
@ -325,8 +338,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
notificationManager, notificationManager,
settingsController, settingsController,
heartRateController, heartRateController,
motionController, motionController);
systemTask->nimble().agenda());
break; break;
case Apps::Error: case Apps::Error:
@ -349,38 +361,26 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
break; break;
case Apps::Notifications: case Apps::Notifications:
currentScreen = std::make_unique<Screens::Notifications>(this, currentScreen = std::make_unique<Screens::Notifications>(
notificationManager, this, notificationManager, systemTask->nimble().alertService(), motorController, Screens::Notifications::Modes::Normal);
systemTask->nimble().alertService(),
motorController,
*systemTask,
Screens::Notifications::Modes::Normal);
ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp); ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp);
break; break;
case Apps::NotificationsPreview: case Apps::NotificationsPreview:
currentScreen = std::make_unique<Screens::Notifications>(this, currentScreen = std::make_unique<Screens::Notifications>(
notificationManager, this, notificationManager, systemTask->nimble().alertService(), motorController, Screens::Notifications::Modes::Preview);
systemTask->nimble().alertService(),
motorController,
*systemTask,
Screens::Notifications::Modes::Preview);
ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp); ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp);
break; break;
case Apps::Timer: case Apps::Timer:
currentScreen = std::make_unique<Screens::Timer>(this, timerController); currentScreen = std::make_unique<Screens::Timer>(this, timerController);
break; break;
case Apps::Alarm: case Apps::Alarm:
currentScreen = std::make_unique<Screens::Alarm>(this, alarmController, settingsController, *systemTask); currentScreen = std::make_unique<Screens::Alarm>(this, alarmController);
break; break;
// Settings // Settings
case Apps::QuickSettings: case Apps::QuickSettings:
currentScreen = std::make_unique<Screens::QuickSettings>(this, currentScreen = std::make_unique<Screens::QuickSettings>(
batteryController, this, batteryController, dateTimeController, brightnessController, motorController, settingsController);
dateTimeController,
brightnessController,
motorController,
settingsController);
ReturnApp(Apps::Clock, FullRefreshDirections::LeftAnim, TouchEvents::SwipeLeft); ReturnApp(Apps::Clock, FullRefreshDirections::LeftAnim, TouchEvents::SwipeLeft);
break; break;
case Apps::Settings: case Apps::Settings:
@ -412,19 +412,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break; break;
case Apps::SettingSetTime: case Apps::SettingSetTime:
currentScreen = std::make_unique<Screens::SettingSetTime>(this, dateTimeController, settingsController); currentScreen = std::make_unique<Screens::SettingSetTime>(this, dateTimeController);
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::SettingChimes:
currentScreen = std::make_unique<Screens::SettingChimes>(this, settingsController);
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::SettingShakeThreshold:
currentScreen = std::make_unique<Screens::SettingShakeThreshold>(this, settingsController, motionController, *systemTask);
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::SettingBluetooth:
currentScreen = std::make_unique<Screens::SettingBluetooth>(this, settingsController);
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break; break;
case Apps::BatteryInfo: case Apps::BatteryInfo:
@ -432,14 +420,8 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break; break;
case Apps::SysInfo: case Apps::SysInfo:
currentScreen = std::make_unique<Screens::SystemInfo>(this, currentScreen = std::make_unique<Screens::SystemInfo>(
dateTimeController, this, dateTimeController, batteryController, brightnessController, bleController, watchdog, motionController, touchPanel);
batteryController,
brightnessController,
bleController,
watchdog,
motionController,
touchPanel);
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break; break;
case Apps::FlashLight: case Apps::FlashLight:
@ -477,10 +459,6 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
case Apps::Steps: case Apps::Steps:
currentScreen = std::make_unique<Screens::Steps>(this, motionController, settingsController); currentScreen = std::make_unique<Screens::Steps>(this, motionController, settingsController);
break; break;
case Apps::Agenda:
currentScreen = std::make_unique<Screens::Agenda>(this, systemTask->nimble().agenda(), dateTimeController);
break;
} }
currentApp = app; currentApp = app;
} }
@ -518,9 +496,6 @@ void DisplayApp::SetFullRefresh(DisplayApp::FullRefreshDirections direction) {
case DisplayApp::FullRefreshDirections::RightAnim: case DisplayApp::FullRefreshDirections::RightAnim:
lvgl.SetFullRefresh(Components::LittleVgl::FullRefreshDirections::RightAnim); lvgl.SetFullRefresh(Components::LittleVgl::FullRefreshDirections::RightAnim);
break; break;
// case DisplayApp::FullRefreshDirections::None:
// lvgl.SetFullRefresh(Components::LittleVgl::FullRefreshDirections::None);
// break;
default: default:
break; break;
} }

View File

@ -61,7 +61,6 @@ namespace Pinetime {
Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::MotionController& motionController,
Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::TimerController& timerController,
Pinetime::Controllers::AlarmController& alarmController, Pinetime::Controllers::AlarmController& alarmController,
Pinetime::Controllers::BrightnessController& brightnessController,
Pinetime::Controllers::TouchHandler& touchHandler); Pinetime::Controllers::TouchHandler& touchHandler);
void Start(System::BootErrors error); void Start(System::BootErrors error);
void PushMessage(Display::Messages msg); void PushMessage(Display::Messages msg);
@ -88,10 +87,10 @@ namespace Pinetime {
Pinetime::Controllers::MotionController& motionController; Pinetime::Controllers::MotionController& motionController;
Pinetime::Controllers::TimerController& timerController; Pinetime::Controllers::TimerController& timerController;
Pinetime::Controllers::AlarmController& alarmController; Pinetime::Controllers::AlarmController& alarmController;
Pinetime::Controllers::BrightnessController& brightnessController;
Pinetime::Controllers::TouchHandler& touchHandler; Pinetime::Controllers::TouchHandler& touchHandler;
Pinetime::Controllers::FirmwareValidator validator; Pinetime::Controllers::FirmwareValidator validator;
Controllers::BrightnessController brightnessController;
TaskHandle_t taskHandle; TaskHandle_t taskHandle;

View File

@ -23,9 +23,9 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::MotionController& motionController,
Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::TimerController& timerController,
Pinetime::Controllers::AlarmController& alarmController, Pinetime::Controllers::AlarmController& alarmController,
Pinetime::Controllers::BrightnessController& brightnessController,
Pinetime::Controllers::TouchHandler& touchHandler) Pinetime::Controllers::TouchHandler& touchHandler)
: lcd {lcd}, bleController {bleController} { : lcd {lcd}, bleController {bleController} {
} }
void DisplayApp::Start() { void DisplayApp::Start() {
@ -120,4 +120,5 @@ void DisplayApp::PushMessage(Display::Messages msg) {
} }
void DisplayApp::Register(Pinetime::System::SystemTask* systemTask) { void DisplayApp::Register(Pinetime::System::SystemTask* systemTask) {
} }

View File

@ -34,7 +34,6 @@ namespace Pinetime {
class MotorController; class MotorController;
class TimerController; class TimerController;
class AlarmController; class AlarmController;
class BrightnessController;
} }
namespace System { namespace System {
@ -58,12 +57,9 @@ namespace Pinetime {
Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::MotionController& motionController,
Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::TimerController& timerController,
Pinetime::Controllers::AlarmController& alarmController, Pinetime::Controllers::AlarmController& alarmController,
Pinetime::Controllers::BrightnessController& brightnessController,
Pinetime::Controllers::TouchHandler& touchHandler); Pinetime::Controllers::TouchHandler& touchHandler);
void Start(); void Start();
void Start(Pinetime::System::BootErrors) { void Start(Pinetime::System::BootErrors){ Start(); };
Start();
};
void PushMessage(Pinetime::Applications::Display::Messages msg); void PushMessage(Pinetime::Applications::Display::Messages msg);
void Register(Pinetime::System::SystemTask* systemTask); void Register(Pinetime::System::SystemTask* systemTask);

View File

@ -20,6 +20,7 @@ namespace Pinetime {
LittleVgl& operator=(LittleVgl&&) = delete; LittleVgl& operator=(LittleVgl&&) = delete;
void Init() { void Init() {
} }
void FlushDisplay(const lv_area_t* area, lv_color_t* color_p) { void FlushDisplay(const lv_area_t* area, lv_color_t* color_p) {
@ -32,6 +33,7 @@ namespace Pinetime {
void SetNewTapEvent(uint16_t x, uint16_t y) { void SetNewTapEvent(uint16_t x, uint16_t y) {
} }
void SetNewTouchPoint(uint16_t x, uint16_t y, bool contact) { void SetNewTouchPoint(uint16_t x, uint16_t y, bool contact) {
} }
}; };
} }

View File

@ -16,22 +16,14 @@ static void disp_flush(lv_disp_drv_t* disp_drv, const lv_area_t* area, lv_color_
lvgl->FlushDisplay(area, color_p); lvgl->FlushDisplay(area, color_p);
} }
static void rounder(lv_disp_drv_t* disp_drv, lv_area_t* area) {
auto* lvgl = static_cast<LittleVgl*>(disp_drv->user_data);
if (lvgl->GetFullRefresh()) {
area->x1 = 0;
area->x2 = LV_HOR_RES - 1;
area->y1 = 0;
area->y2 = LV_VER_RES - 1;
}
}
bool touchpad_read(lv_indev_drv_t* indev_drv, lv_indev_data_t* data) { bool touchpad_read(lv_indev_drv_t* indev_drv, lv_indev_data_t* data) {
auto* lvgl = static_cast<LittleVgl*>(indev_drv->user_data); auto* lvgl = static_cast<LittleVgl*>(indev_drv->user_data);
return lvgl->GetTouchPadInfo(data); return lvgl->GetTouchPadInfo(data);
} }
LittleVgl::LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel) : lcd {lcd}, touchPanel {touchPanel} { LittleVgl::LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel)
: lcd {lcd}, touchPanel {touchPanel}, previousClick {0, 0} {
} }
void LittleVgl::Init() { void LittleVgl::Init() {
@ -56,7 +48,6 @@ void LittleVgl::InitDisplay() {
/*Set a display buffer*/ /*Set a display buffer*/
disp_drv.buffer = &disp_buf_2; disp_drv.buffer = &disp_buf_2;
disp_drv.user_data = this; disp_drv.user_data = this;
disp_drv.rounder_cb = rounder;
/*Finally register the driver*/ /*Finally register the driver*/
lv_disp_drv_register(&disp_drv); lv_disp_drv_register(&disp_drv);
@ -87,15 +78,14 @@ void LittleVgl::SetFullRefresh(FullRefreshDirections direction) {
lv_disp_set_direction(lv_disp_get_default(), 4); lv_disp_set_direction(lv_disp_get_default(), 4);
} }
} }
fullRefresh = true;
} }
void LittleVgl::FlushDisplay(const lv_area_t* area, lv_color_t* color_p) { void LittleVgl::FlushDisplay(const lv_area_t* area, lv_color_t* color_p) {
uint16_t y1, y2, width, height = 0; uint16_t y1, y2, width, height = 0;
ulTaskNotifyTake(pdTRUE, 200); ulTaskNotifyTake(pdTRUE, 200);
// Notification is still needed (even if there is a mutex on SPI) because of the DataCommand pin // NOtification is still needed (even if there is a mutex on SPI) because of the DataCommand pin
// which cannot be set/clear during a transfer. // which cannot be set/clear during a transfert.
if ((scrollDirection == LittleVgl::FullRefreshDirections::Down) && (area->y2 == visibleNbLines - 1)) { if ((scrollDirection == LittleVgl::FullRefreshDirections::Down) && (area->y2 == visibleNbLines - 1)) {
writeOffset = ((writeOffset + totalNbLines) - visibleNbLines) % totalNbLines; writeOffset = ((writeOffset + totalNbLines) - visibleNbLines) % totalNbLines;
@ -195,13 +185,8 @@ bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
void LittleVgl::InitTheme() { void LittleVgl::InitTheme() {
lv_theme_t* th = lv_pinetime_theme_init(LV_COLOR_WHITE, lv_theme_t* th = lv_pinetime_theme_init(
LV_COLOR_SILVER, LV_COLOR_WHITE, LV_COLOR_SILVER, 0, &jetbrains_mono_bold_20, &jetbrains_mono_bold_20, &jetbrains_mono_bold_20, &jetbrains_mono_bold_20);
0,
&jetbrains_mono_bold_20,
&jetbrains_mono_bold_20,
&jetbrains_mono_bold_20,
&jetbrains_mono_bold_20);
lv_theme_set_act(th); lv_theme_set_act(th);
} }

View File

@ -26,14 +26,6 @@ namespace Pinetime {
void SetFullRefresh(FullRefreshDirections direction); void SetFullRefresh(FullRefreshDirections direction);
void SetNewTouchPoint(uint16_t x, uint16_t y, bool contact); void SetNewTouchPoint(uint16_t x, uint16_t y, bool contact);
bool GetFullRefresh() {
bool returnValue = fullRefresh;
if (fullRefresh) {
fullRefresh = false;
}
return returnValue;
}
private: private:
void InitDisplay(); void InitDisplay();
void InitTouchpad(); void InitTouchpad();
@ -47,8 +39,9 @@ namespace Pinetime {
lv_color_t buf2_2[LV_HOR_RES_MAX * 4]; lv_color_t buf2_2[LV_HOR_RES_MAX * 4];
lv_disp_drv_t disp_drv; lv_disp_drv_t disp_drv;
lv_point_t previousClick;
bool fullRefresh = false; bool firstTouch = true;
static constexpr uint8_t nbWriteLines = 4; static constexpr uint8_t nbWriteLines = 4;
static constexpr uint16_t totalNbLines = 320; static constexpr uint16_t totalNbLines = 320;
static constexpr uint16_t visibleNbLines = 240; static constexpr uint16_t visibleNbLines = 240;

View File

@ -20,9 +20,7 @@ namespace Pinetime {
DimScreen, DimScreen,
RestoreBrightness, RestoreBrightness,
ShowPairingKey, ShowPairingKey,
AlarmTriggered, AlarmTriggered
Clock,
BleRadioEnableToggle
}; };
} }
} }

View File

@ -1,35 +0,0 @@
set(FONTS jetbrains_mono_42 jetbrains_mono_76 jetbrains_mono_bold_20
jetbrains_mono_extrabold_compressed lv_font_navi_80 lv_font_sys_48
open_sans_light)
find_program(LV_FONT_CONV "lv_font_conv" NO_CACHE REQUIRED
HINTS "${CMAKE_SOURCE_DIR}/node_modules/.bin")
message(STATUS "Using ${LV_FONT_CONV} to generate font files")
configure_file(${CMAKE_CURRENT_LIST_DIR}/jetbrains_mono_bold_20.c_zero.patch
${CMAKE_CURRENT_BINARY_DIR}/jetbrains_mono_bold_20.c_zero.patch COPYONLY)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
# FindPython3 module introduces with CMake 3.12
# https://cmake.org/cmake/help/latest/module/FindPython3.html
find_package(Python3 REQUIRED)
else()
set(Python3_EXECUTABLE "python")
endif()
# create static library building fonts
add_library(infinitime_fonts STATIC)
# add include directory to lvgl headers needed to compile the font files on its own
target_include_directories(infinitime_fonts PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../libs")
foreach(FONT ${FONTS})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FONT}.c
COMMAND "${Python3_EXECUTABLE}" ${CMAKE_CURRENT_SOURCE_DIR}/generate.py
--lv-font-conv "${LV_FONT_CONV}"
--font ${FONT} ${CMAKE_CURRENT_SOURCE_DIR}/fonts.json
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/fonts.json
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(infinitime_fonts_${FONT}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FONT}.c
)
target_sources(infinitime_fonts PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${FONT}.c")
add_dependencies(infinitime_fonts infinitime_fonts_${FONT})
endforeach()

View File

@ -4,10 +4,25 @@
* [Awesome font from LVGL](https://lvgl.io/assets/others/FontAwesome5-Solid+Brands+Regular.woff) * [Awesome font from LVGL](https://lvgl.io/assets/others/FontAwesome5-Solid+Brands+Regular.woff)
* [Open Sans Light from Google](https://fonts.google.com/specimen/Open+Sans) * [Open Sans Light from Google](https://fonts.google.com/specimen/Open+Sans)
### How to add new symbols: ## Generate the fonts:
* Browse [this cheatsheet](https://fontawesome.com/cheatsheet/free/solid) and pick symbols * Open the [LVGL font converter](https://lvgl.io/tools/fontconverter)
* For each symbol, add its hex code (0xf641 for the 'Ad' icon, for example) to the *Range* list (or the symbol list when its simple enough) in the `fonts.json` file * Name : jetbrains_mono_bold_20
* Size : 20
* Bpp : 1 bit-per-pixel
* Do not enable font compression and horizontal subpixel hinting
* Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x20-0x7f, 0x410-0x44f`
* Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following
range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015`
* Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts`
* Add the font .c file path to src/CMakeLists.txt
* Add an LV_FONT_DECLARE line in src/libs/lv_conf.h
Add new symbols:
* Browse the [cheatsheet](https://fontawesome.com/cheatsheet/free/solid) and find your new symbols
* For each symbol, add its hex code (0xf641 for the 'Ad' icon, for example) to the *Range* list (Remember to keep this
readme updated with newest range list)
* Convert this hex value into a UTF-8 code * Convert this hex value into a UTF-8 code
using [this site](http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=f185&mode=hex) using [this site](http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=f185&mode=hex)
* Define the new symbols in `src/displayapp/screens/Symbols.h`: * Define the new symbols in `src/displayapp/screens/Symbols.h`:
@ -16,17 +31,32 @@
static constexpr const char* newSymbol = "\xEF\x86\x85"; static constexpr const char* newSymbol = "\xEF\x86\x85";
``` ```
### the config file format: ## Simple method to generate a font
inside `fonts`, there is a dictionary of fonts, If you want to generate a basic font containing only numbers and letters, you can use the above settings but instead of specifying a range, simply list the characters you need in the Symbols field and leave the range blank. This is the approach used for the PineTimeStyle watchface.
and for each font there is: This works well for fonts which will only be used to display numbers, but will fail if you try to add a colon or other punctuation.
* sources - list of file,range(,symbols) wanted (as a dictionary of those)
* bpp - bits per pixel.
* size - size.
* patches - list of extra "patches" to run: a path to a .patch file. (may be relative)
* compress - optional. default disabled. add `"compress": true` to enable
### Navigation font * Open the [LVGL font converter](https://lvgl.io/tools/fontconverter)
* Name : open_sans_light
* Size : 150
* Bpp : 1 bit-per-pixel
* Do not enable font compression and horizontal subpixel hinting
* Load the file `open_sans_light.tff` (use the file in this repo to ensure the version matches) and specify the following symbols : `0123456789`
* Click on Convert, and download the file `open_sans_light.c` and copy it in `src/DisplayApp/Fonts`
* Add the font .c file path to src/CMakeLists.txt (search for jetbrains to find the appropriate location/format)
* Add an LV_FONT_DECLARE line in src/libs/lv_conf.h (as above)
`navigtion.ttf` is created with the web app [icomoon](https://icomoon.io/app) by importing the svg files from `src/displayapp/icons/navigation/unique` and generating the font. `lv_font_navi_80.json` is a project file for the site, which you can import to add or remove icons. #### Navigation font
To create the navigtion.ttf I use the web app [icomoon](https://icomoon.io/app)
this app can import the svg files from the folder *src/displayapp/icons/navigation/unique* and creat a ttf file the
project for the site is *lv_font_navi_80.json* you can import it to add or remove icons
You can also use the online LVGL tool to create the .c
ttf file : navigation.ttf name : lv_font_navi_80 size : 80px Bpp : 2 bit-per-pixel range : 0xe900-0xe929
$lv_font_conv --font navigation.ttf -r '0xe900-0xe929' --size 80 --format lvgl --bpp 2 --no-prefilter -o
lv_font_navi_80.c
#### I use the method above to create the other ttf

View File

@ -1,78 +0,0 @@
{
"jetbrains_mono_bold_20": {
"sources": [
{
"file": "JetBrainsMono-Bold.ttf",
"range": "0x20-0x7e, 0x410-0x44f"
},
{
"file": "FontAwesome5-Solid+Brands+Regular.woff",
"range": "0xf294, 0xf242, 0xf54b, 0xf21e, 0xf1e6, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015"
}
],
"bpp": 1,
"size": 20,
"patches": ["jetbrains_mono_bold_20.c_zero.patch"]
},
"jetbrains_mono_42": {
"sources": [
{
"file": "JetBrainsMono-Regular.ttf",
"range": "0x25, 0x2b, 0x2d, 0x30-0x3a"
}
],
"bpp": 1,
"size": 42
},
"jetbrains_mono_76": {
"sources": [
{
"file": "JetBrainsMono-Light.ttf",
"range": "0x25, 0x2D, 0x2F, 0x30-0x3a"
}
],
"bpp": 1,
"size": 76
},
"jetbrains_mono_extrabold_compressed": {
"sources": [
{
"file": "JetBrainsMono-ExtraBold.ttf",
"range": "0x30-0x3a"
}
],
"bpp": 1,
"size": 80
},
"open_sans_light": {
"sources": [
{
"file": "open_sans_light.ttf",
"symbols": "0123456789"
}
],
"bpp": 1,
"size": 150
},
"lv_font_sys_48": {
"sources": [
{
"file": "icons_sys_48.ttf",
"range": "0xe902, 0xe904-0xe907, 0xe90b-0xe90c"
}
],
"bpp": 1,
"size": 48
},
"lv_font_navi_80": {
"sources": [
{
"file": "navigation.ttf",
"range": "0xe900-0xe929"
}
],
"bpp": 2,
"size": 80,
"compress": true
}
}

View File

@ -1,75 +0,0 @@
#!/usr/bin/env python
import io
import sys
import json
import shutil
import typing
import os.path
import argparse
import subprocess
class Source(object):
def __init__(self, d):
self.file = d['file']
if not os.path.exists(self.file):
self.file = os.path.join(os.path.dirname(sys.argv[0]), self.file)
self.range = d.get('range')
self.symbols = d.get('symbols')
def gen_lvconv_line(lv_font_conv: str, dest: str, size: int, bpp: int, sources: typing.List[Source], compress:bool=False):
args = [lv_font_conv, '--size', str(size), '--output', dest, '--bpp', str(bpp), '--format', 'lvgl']
if not compress:
args.append('--no-compress')
for source in sources:
args.extend(['--font', source.file])
if source.range:
args.extend(['--range', source.range])
if source.symbols:
args.extend(['--symbols', source.symbols])
return args
def main():
ap = argparse.ArgumentParser(description='auto generate LVGL font files from fonts')
ap.add_argument('config', type=str, help='config file to use')
ap.add_argument('-f', '--font', type=str, action='append', help='Choose specific fonts to generate (default: all)', default=[])
ap.add_argument('--lv-font-conv', type=str, help='Path to "lv_font_conf" executable', default="lv_font_conv")
args = ap.parse_args()
if not shutil.which(args.lv_font_conv):
sys.exit(f"Missing lv_font_conv. Make sure it's findable (in PATH) or specify it manually")
if not os.path.exists(args.config):
sys.exit(f'Error: the config file {args.config} does not exist.')
if not os.access(args.config, os.R_OK):
sys.exit(f'Error: the config file {args.config} is not accessible (permissions?).')
with open(args.config, 'r') as fd:
data = json.load(fd)
fonts_to_run = set(data.keys())
if args.font:
enabled_fonts = set()
for font in args.font:
enabled_fonts.add(font[:-2] if font.endswith('.c') else font)
d = enabled_fonts.difference(fonts_to_run)
if d:
print(f'Warning: requested font{"s" if len(d)>1 else ""} missing: {" ".join(d)}')
fonts_to_run = fonts_to_run.intersection(enabled_fonts)
for name in fonts_to_run:
font = data[name]
sources = font.pop('sources')
patches = font.pop('patches') if 'patches' in font else []
font['sources'] = [Source(thing) for thing in sources]
line = gen_lvconv_line(args.lv_font_conv, f'{name}.c', **font)
subprocess.check_call(line)
if patches:
for patch in patches:
subprocess.check_call(['/usr/bin/patch', name+'.c', patch])
if __name__ == '__main__':
main()

View File

@ -0,0 +1,258 @@
/*******************************************************************************
* Size: 42 px
* Bpp: 1
* Opts:
******************************************************************************/
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef JETBRAINS_MONO_42
#define JETBRAINS_MONO_42 1
#endif
#if JETBRAINS_MONO_42
/*-----------------
* BITMAPS
*----------------*/
/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
/* U+0025 "%" */
0x1f, 0x80, 0x7, 0x3f, 0xc0, 0xe, 0x7f, 0xe0,
0x1c, 0xf0, 0xf0, 0x1c, 0xe0, 0x70, 0x38, 0xe0,
0x70, 0x70, 0xe0, 0x70, 0x70, 0xe0, 0x70, 0xe0,
0xe0, 0x71, 0xc0, 0xe0, 0x71, 0xc0, 0xf0,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x1f, 0xff, 0x83,
0xe0, 0xfc, 0x7c, 0x3, 0xe7, 0x80, 0x1e, 0xf8,
0x1, 0xff, 0x0, 0xf, 0xf0, 0x0, 0xff, 0x0,
0xf, 0xf0, 0x0, 0xff, 0x0, 0xf, 0xf8, 0x1,
0xf7, 0x80, 0x1e, 0x7c, 0x3, 0xe3, 0xe0, 0x7e,
0x3f, 0xff, 0xc1, 0xff, 0xfc, 0x7, 0xe7, 0x80,
0x0, 0xf8, 0x0, 0xf, 0x0, 0x1, 0xe0, 0x0,
0x1e, 0x0, 0x3, 0xc0, 0x0, 0x3c, 0x0, 0x7,
0x80, 0x0, 0xf8, 0x0, 0xf, 0x0, 0x1, 0xe0,
0x0, 0x1e, 0x0, 0x3, 0xc0, 0x0,
/* U+003A ":" */
0x7d, 0xff, 0xff, 0xff, 0xef, 0x80, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
0xf7, 0xff, 0xff, 0xff, 0xbe
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
{.bitmap_index = 0, .adv_w = 403, .box_w = 24, .box_h = 31, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 93, .adv_w = 403, .box_w = 19, .box_h = 31, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 167, .adv_w = 403, .box_w = 19, .box_h = 31, .ofs_x = 4, .ofs_y = 0},
{.bitmap_index = 241, .adv_w = 403, .box_w = 19, .box_h = 31, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 315, .adv_w = 403, .box_w = 19, .box_h = 31, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 389, .adv_w = 403, .box_w = 18, .box_h = 31, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 459, .adv_w = 403, .box_w = 18, .box_h = 31, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 529, .adv_w = 403, .box_w = 20, .box_h = 31, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 607, .adv_w = 403, .box_w = 20, .box_h = 31, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 685, .adv_w = 403, .box_w = 20, .box_h = 31, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 763, .adv_w = 403, .box_w = 20, .box_h = 31, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 841, .adv_w = 403, .box_w = 7, .box_h = 24, .ofs_x = 9, .ofs_y = 0}
};
/*---------------------
* CHARACTER MAPPING
*--------------------*/
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
{
.range_start = 37, .range_length = 1, .glyph_id_start = 1,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
},
{
.range_start = 48, .range_length = 11, .glyph_id_start = 2,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
}
};
/*--------------------
* ALL CUSTOM DATA
*--------------------*/
#if LV_VERSION_CHECK(8, 0, 0)
/*Store all the custom data of the font*/
static lv_font_fmt_txt_glyph_cache_t cache;
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
.glyph_bitmap = glyph_bitmap,
.glyph_dsc = glyph_dsc,
.cmaps = cmaps,
.kern_dsc = NULL,
.kern_scale = 0,
.cmap_num = 2,
.bpp = 1,
.kern_classes = 0,
.bitmap_format = 0,
#if LV_VERSION_CHECK(8, 0, 0)
.cache = &cache
#endif
};
/*-----------------
* PUBLIC FONT
*----------------*/
/*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t jetbrains_mono_42 = {
#else
lv_font_t jetbrains_mono_42 = {
#endif
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.line_height = 31, /*The maximum line height required by the font*/
.base_line = 0, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -7,
.underline_thickness = 2,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if JETBRAINS_MONO_42*/

View File

@ -0,0 +1,554 @@
/*******************************************************************************
* Size: 76 px
* Bpp: 1
* Opts:
******************************************************************************/
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef JETBRAINS_MONO_76
#define JETBRAINS_MONO_76 1
#endif
#if JETBRAINS_MONO_76
/*-----------------
* BITMAPS
*----------------*/
/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
/* U+0025 "%" */
0x1, 0xfc, 0x0, 0x0, 0x7, 0xe1, 0xff, 0xf0,
0x0, 0x1, 0xf8, 0x7f, 0xff, 0x0, 0x0, 0x3f,
0x1f, 0xff, 0xf0, 0x0, 0xf, 0xc7, 0xff, 0xff,
0x0, 0x3, 0xf0, 0xfe, 0xf, 0xe0, 0x0, 0x7e,
0x3f, 0x80, 0xfc, 0x0, 0x1f, 0x87, 0xe0, 0xf,
0xc0, 0x7, 0xe0, 0xfc, 0x1, 0xf8, 0x0, 0xfc,
0x1f, 0x80, 0x3f, 0x0, 0x3f, 0x3, 0xf0, 0x7,
0xe0, 0xf, 0xc0, 0x7e, 0x0, 0xfc, 0x1, 0xf8,
0xf, 0xc0, 0x1f, 0x80, 0x7e, 0x1, 0xf8, 0x3,
0xf0, 0x1f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0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0xff, 0x1f,
0xfc, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x7f, 0xf3, 0xff, 0x8f, 0xf8, 0x4, 0x0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
{.bitmap_index = 0, .adv_w = 730, .box_w = 43, .box_h = 57, .ofs_x = 1, .ofs_y = -1},
{.bitmap_index = 307, .adv_w = 730, .box_w = 24, .box_h = 6, .ofs_x = 11, .ofs_y = 22},
{.bitmap_index = 325, .adv_w = 730, .box_w = 34, .box_h = 72, .ofs_x = 6, .ofs_y = -8},
{.bitmap_index = 631, .adv_w = 730, .box_w = 34, .box_h = 58, .ofs_x = 6, .ofs_y = -1},
{.bitmap_index = 878, .adv_w = 730, .box_w = 34, .box_h = 56, .ofs_x = 7, .ofs_y = 0},
{.bitmap_index = 1116, .adv_w = 730, .box_w = 34, .box_h = 57, .ofs_x = 6, .ofs_y = 0},
{.bitmap_index = 1359, .adv_w = 730, .box_w = 34, .box_h = 57, .ofs_x = 5, .ofs_y = -1},
{.bitmap_index = 1602, .adv_w = 730, .box_w = 32, .box_h = 56, .ofs_x = 6, .ofs_y = 0},
{.bitmap_index = 1826, .adv_w = 730, .box_w = 32, .box_h = 57, .ofs_x = 7, .ofs_y = -1},
{.bitmap_index = 2054, .adv_w = 730, .box_w = 36, .box_h = 58, .ofs_x = 5, .ofs_y = -1},
{.bitmap_index = 2315, .adv_w = 730, .box_w = 36, .box_h = 56, .ofs_x = 5, .ofs_y = 0},
{.bitmap_index = 2567, .adv_w = 730, .box_w = 36, .box_h = 58, .ofs_x = 5, .ofs_y = -1},
{.bitmap_index = 2828, .adv_w = 730, .box_w = 36, .box_h = 57, .ofs_x = 5, .ofs_y = 0},
{.bitmap_index = 3085, .adv_w = 730, .box_w = 13, .box_h = 44, .ofs_x = 16, .ofs_y = -1}
};
/*---------------------
* CHARACTER MAPPING
*--------------------*/
static const uint16_t unicode_list_0[] = {
0x0, 0x8
};
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
{
.range_start = 37, .range_length = 9, .glyph_id_start = 1,
.unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 2, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
},
{
.range_start = 47, .range_length = 12, .glyph_id_start = 3,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
}
};
/*--------------------
* ALL CUSTOM DATA
*--------------------*/
#if LV_VERSION_CHECK(8, 0, 0)
/*Store all the custom data of the font*/
static lv_font_fmt_txt_glyph_cache_t cache;
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
.glyph_bitmap = glyph_bitmap,
.glyph_dsc = glyph_dsc,
.cmaps = cmaps,
.kern_dsc = NULL,
.kern_scale = 0,
.cmap_num = 2,
.bpp = 1,
.kern_classes = 0,
.bitmap_format = 0,
#if LV_VERSION_CHECK(8, 0, 0)
.cache = &cache
#endif
};
/*-----------------
* PUBLIC FONT
*----------------*/
/*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t jetbrains_mono_76 = {
#else
lv_font_t jetbrains_mono_76 = {
#endif
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.line_height = 72, /*The maximum line height required by the font*/
.base_line = 8, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = -12,
.underline_thickness = 4,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if JETBRAINS_MONO_76*/

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
91,92c91,92
< 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7f,
< 0xdf, 0xf7, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f,
---
> 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e,
> 0xdf, 0xb7, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f,

View File

@ -0,0 +1,507 @@
#include "lvgl/lvgl.h"
/*******************************************************************************
* Size: 80 px
* Bpp: 1
* Opts:
******************************************************************************/
#ifndef JETBRAINS_MONO_EXTRABOLD_COMPRESSED
#define JETBRAINS_MONO_EXTRABOLD_COMPRESSED 1
#endif
#if JETBRAINS_MONO_EXTRABOLD_COMPRESSED
/*-----------------
* BITMAPS
*----------------*/
/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {
/* U+30 "0" */
0x0, 0x1, 0xff, 0xc0, 0x0, 0x0, 0xf, 0xff,
0xfe, 0x0, 0x0, 0x1f, 0xff, 0xff, 0xc0, 0x0,
0x3f, 0xff, 0xff, 0xf8, 0x0, 0x3f, 0xff, 0xff,
0xfe, 0x0, 0x3f, 0xff, 0xff, 0xff, 0x80, 0x3f,
0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0xff, 0xff,
0xf8, 0x1f, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xff,
0xff, 0xff, 0xff, 0x1f, 0xff, 0xe0, 0x3f, 0xff,
0xcf, 0xff, 0xc0, 0x7, 0xff, 0xe7, 0xff, 0xc0,
0x1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xff,
0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff,
0xdf, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff,
0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xfb,
0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff,
0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xff,
0xff, 0xc0,
/* U+33 "3" */
0x1f, 0xff, 0xff, 0xff, 0xfe, 0xf, 0xff, 0xff,
0xff, 0xff, 0x7, 0xff, 0xff, 0xff, 0xff, 0x83,
0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff,
0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f,
0xff, 0xff, 0xff, 0xf8, 0x3f, 0xff, 0xff, 0xff,
0xfc, 0x1f, 0xff, 0xff, 0xff, 0xfe, 0xf, 0xff,
0xff, 0x8f, 0xff, 0x0, 0x0, 0x0, 0xf, 0xff,
0x80, 0x0, 0x0, 0x1f, 0xff, 0x80, 0x0, 0x0,
0x1f, 0xff, 0x80, 0x0, 0x0, 0x3f, 0xff, 0x80,
0x0, 0x0, 0x3f, 0xff, 0x0, 0x0, 0x0, 0x3f,
0xff, 0x0, 0x0, 0x0, 0x3f, 0xff, 0x0, 0x0,
0x0, 0x3f, 0xff, 0x0, 0x0, 0x0, 0x3f, 0xfe,
0x0, 0x0, 0x0, 0x3f, 0xfe, 0x0, 0x0, 0x0,
0x3f, 0xfe, 0x0, 0x0, 0x0, 0x3f, 0xfc, 0x0,
0x0, 0x0, 0x1f, 0xff, 0x80, 0x0, 0x0, 0xf,
0xff, 0xf8, 0x0, 0x0, 0x7, 0xff, 0xff, 0x0,
0x0, 0x3, 0xff, 0xff, 0xe0, 0x0, 0x1, 0xff,
0xff, 0xf8, 0x0, 0x0, 0xff, 0xff, 0xfe, 0x0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xff, 0xe7, 0xff, 0xc0, 0x0, 0xff, 0xf9, 0xff,
0xfc, 0x0, 0xff, 0xfe, 0x3f, 0xff, 0xc0, 0xff,
0xff, 0xf, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff,
0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0xff, 0xff,
0xf0, 0x7, 0xff, 0xff, 0xff, 0xf8, 0x0, 0xff,
0xff, 0xff, 0xfe, 0x0, 0x1f, 0xff, 0xff, 0xfe,
0x0, 0x3, 0xff, 0xff, 0xff, 0x0, 0x0, 0x3f,
0xff, 0xff, 0x0, 0x0, 0x3, 0xff, 0xff, 0x0,
0x0, 0x0, 0xf, 0xfc, 0x0, 0x0,
/* U+37 "7" */
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xe0, 0x0, 0xf, 0xff, 0xff, 0xe0, 0x0, 0x1f,
0xfe, 0xff, 0xe0, 0x0, 0x1f, 0xfe, 0xff, 0xe0,
0x0, 0x3f, 0xfc, 0xff, 0xe0, 0x0, 0x3f, 0xfc,
0xff, 0xe0, 0x0, 0x7f, 0xf8, 0xff, 0xe0, 0x0,
0x7f, 0xf8, 0xff, 0xe0, 0x0, 0xff, 0xf8, 0xff,
0xe0, 0x0, 0xff, 0xf0, 0x0, 0x0, 0x1, 0xff,
0xf0, 0x0, 0x0, 0x1, 0xff, 0xe0, 0x0, 0x0,
0x3, 0xff, 0xe0, 0x0, 0x0, 0x3, 0xff, 0xc0,
0x0, 0x0, 0x7, 0xff, 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 0x0, 0x3f,
0xff, 0x0, 0x0, 0x0, 0xf, 0xff, 0x80, 0x0,
0x0, 0x7, 0xff, 0xe0, 0x0, 0x0,
/* U+3A ":" */
0x7, 0xe0, 0x1f, 0xf8, 0x3f, 0xfc, 0x7f, 0xfe,
0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe,
0x7f, 0xfe, 0x3f, 0xfc, 0x1f, 0xf8, 0x7, 0xe0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x7, 0xe0, 0x1f, 0xf8,
0x3f, 0xfc, 0x7f, 0xfe, 0x7f, 0xfe, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x7f, 0xfe, 0x7f, 0xfe, 0x3f, 0xfc,
0x1f, 0xf8, 0x7, 0xe0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
{.bitmap_index = 0, .adv_w = 768, .box_w = 41, .box_h = 59, .ofs_x = 4, .ofs_y = -1},
{.bitmap_index = 303, .adv_w = 768, .box_w = 40, .box_h = 58, .ofs_x = 6, .ofs_y = 0},
{.bitmap_index = 593, .adv_w = 768, .box_w = 41, .box_h = 58, .ofs_x = 4, .ofs_y = 0},
{.bitmap_index = 891, .adv_w = 768, .box_w = 41, .box_h = 59, .ofs_x = 3, .ofs_y = -1},
{.bitmap_index = 1194, .adv_w = 768, .box_w = 38, .box_h = 58, .ofs_x = 4, .ofs_y = 0},
{.bitmap_index = 1470, .adv_w = 768, .box_w = 41, .box_h = 58, .ofs_x = 4, .ofs_y = -1},
{.bitmap_index = 1768, .adv_w = 768, .box_w = 42, .box_h = 59, .ofs_x = 3, .ofs_y = -1},
{.bitmap_index = 2078, .adv_w = 768, .box_w = 40, .box_h = 58, .ofs_x = 4, .ofs_y = 0},
{.bitmap_index = 2368, .adv_w = 768, .box_w = 42, .box_h = 60, .ofs_x = 3, .ofs_y = -1},
{.bitmap_index = 2683, .adv_w = 768, .box_w = 42, .box_h = 59, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 2993, .adv_w = 768, .box_w = 16, .box_h = 46, .ofs_x = 16, .ofs_y = -1}
};
/*---------------------
* CHARACTER MAPPING
*--------------------*/
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
{
.range_start = 48, .range_length = 11, .glyph_id_start = 1,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
}
};
/*--------------------
* ALL CUSTOM DATA
*--------------------*/
/*Store all the custom data of the font*/
static lv_font_fmt_txt_dsc_t font_dsc = {
.glyph_bitmap = gylph_bitmap,
.glyph_dsc = glyph_dsc,
.cmaps = cmaps,
.kern_dsc = NULL,
.kern_scale = 0,
.cmap_num = 1,
.bpp = 1,
.kern_classes = 0,
.bitmap_format = 0
};
/*-----------------
* PUBLIC FONT
*----------------*/
/*Initialize a public general font descriptor*/
lv_font_t jetbrains_mono_extrabold_compressed = {
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.line_height = 60, /*The maximum line height required by the font*/
.base_line = 1, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if JETBRAINS_MONO_EXTRABOLD_COMPRESSED*/

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,324 @@
/*******************************************************************************
* Size: 48 px
* Bpp: 1
* Opts:
******************************************************************************/
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef LV_FONT_SYS_48
#define LV_FONT_SYS_48 1
#endif
#if LV_FONT_SYS_48
/*-----------------
* BITMAPS
*----------------*/
/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
/* U+E902 "" */
0x0, 0x1, 0xff, 0x80, 0x0, 0x0, 0x1, 0xff,
0x80, 0x0, 0x0, 0x1, 0xff, 0x80, 0x0, 0x0,
0x1, 0xff, 0x80, 0x0, 0x0, 0x1, 0xff, 0x80,
0x0, 0x0, 0x3, 0xff, 0xc0, 0x0, 0x6, 0x7,
0xff, 0xe0, 0x60, 0xf, 0x8f, 0xff, 0xf1, 0xf0,
0xf, 0xff, 0xff, 0xff, 0xf0, 0x1f, 0xff, 0xff,
0xff, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xfc, 0x3f,
0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xff,
0xfe, 0x7f, 0xff, 0x81, 0xff, 0xfe, 0x7f, 0xff,
0x0, 0xff, 0xfe, 0x3f, 0xfe, 0x0, 0x7f, 0xfc,
0x1f, 0xfc, 0x0, 0x3f, 0xf8, 0xf, 0xf8, 0x0,
0x1f, 0xf0, 0x7, 0xf8, 0x0, 0x1f, 0xe0, 0x7,
0xf8, 0x0, 0x1f, 0xe0, 0x7, 0xf8, 0x0, 0x1f,
0xe0, 0x7, 0xf8, 0x0, 0x1f, 0xe0, 0xf, 0xf8,
0x0, 0x1f, 0xf0, 0x1f, 0xfc, 0x0, 0x3f, 0xf8,
0x3f, 0xfe, 0x0, 0x7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0xff, 0xff, 0xff, 0x0, 0x1,
0xff, 0xff, 0xff, 0x80, 0x3, 0xff, 0xff, 0xff,
0xc0, 0x7, 0xff, 0xff, 0xff, 0xe0, 0xf, 0xff,
0xff, 0xff, 0xf0, 0xf, 0xff, 0xff, 0xff, 0xf0,
0xf, 0xff, 0xff, 0xff, 0xf0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0,
0x0, 0x0, 0x0, 0x7e, 0x0, 0x0, 0x0, 0x0,
0x3c, 0x0, 0x0
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
{.bitmap_index = 0, .adv_w = 768, .box_w = 40, .box_h = 40, .ofs_x = 4, .ofs_y = 0},
{.bitmap_index = 200, .adv_w = 768, .box_w = 46, .box_h = 46, .ofs_x = 1, .ofs_y = -3},
{.bitmap_index = 465, .adv_w = 768, .box_w = 46, .box_h = 46, .ofs_x = 1, .ofs_y = -3},
{.bitmap_index = 730, .adv_w = 768, .box_w = 46, .box_h = 46, .ofs_x = 1, .ofs_y = -3},
{.bitmap_index = 995, .adv_w = 768, .box_w = 34, .box_h = 40, .ofs_x = 7, .ofs_y = 0},
{.bitmap_index = 1165, .adv_w = 768, .box_w = 34, .box_h = 39, .ofs_x = 8, .ofs_y = 0},
{.bitmap_index = 1331, .adv_w = 768, .box_w = 40, .box_h = 39, .ofs_x = 4, .ofs_y = 0}
};
/*---------------------
* CHARACTER MAPPING
*--------------------*/
static const uint8_t glyph_id_ofs_list_0[] = {
0, 0, 1, 2, 3, 4, 0, 0,
0, 5, 6
};
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
{
.range_start = 59650, .range_length = 11, .glyph_id_start = 1,
.unicode_list = NULL, .glyph_id_ofs_list = glyph_id_ofs_list_0, .list_length = 11, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL
}
};
/*--------------------
* ALL CUSTOM DATA
*--------------------*/
#if LV_VERSION_CHECK(8, 0, 0)
/*Store all the custom data of the font*/
static lv_font_fmt_txt_glyph_cache_t cache;
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
.glyph_bitmap = glyph_bitmap,
.glyph_dsc = glyph_dsc,
.cmaps = cmaps,
.kern_dsc = NULL,
.kern_scale = 0,
.cmap_num = 1,
.bpp = 1,
.kern_classes = 0,
.bitmap_format = 0,
#if LV_VERSION_CHECK(8, 0, 0)
.cache = &cache
#endif
};
/*-----------------
* PUBLIC FONT
*----------------*/
/*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t lv_font_sys_48 = {
#else
lv_font_t lv_font_sys_48 = {
#endif
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.line_height = 46, /*The maximum line height required by the font*/
.base_line = 3, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
.underline_position = 0,
.underline_thickness = 0,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if LV_FONT_SYS_48*/

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

View File

@ -1,52 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_BATTERYICON
#define LV_ATTRIBUTE_IMG_BATTERYICON
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BATTERYICON uint8_t batteryicon_map[] = {
0xff, 0xff, 0xff, 0xff, /*Color of index 0*/
0x6a, 0xfc, 0x6c, 0xff, /*Color of index 1*/
0xe0, 0x70,
0xe0, 0x70,
0x00, 0x00,
0x00, 0x00,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x3f, 0xc0,
0x00, 0x00,
0x00, 0x00,
};
const lv_img_dsc_t batteryicon = {
{
LV_IMG_CF_INDEXED_1BIT,
0,
0,
12,
20,
},
48,
batteryicon_map,
};

View File

@ -0,0 +1,56 @@
#include "lvgl/lvgl.h"
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_005
#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_005
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_005 uint8_t ck_os_battery_005_map[] = {
0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/
0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/
0xfc, 0x00, 0x3f,
0xf8, 0x00, 0x1f,
0xf0, 0x00, 0x0f,
0xf0, 0x00, 0x0f,
0x00, 0xff, 0x00,
0x00, 0xff, 0x00,
0x00, 0xff, 0x00,
0x00, 0xff, 0x00,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x0f, 0xff, 0xf0,
0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
};
const lv_img_dsc_t ck_os_battery_005 = {
.header.always_zero = 0,
.header.w = 24,
.header.h = 32,
.data_size = 104,
.header.cf = LV_IMG_CF_INDEXED_1BIT,
.data = ck_os_battery_005_map,
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,58 @@
#include "lvgl/lvgl.h"
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_010
#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_010
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_010 uint8_t ck_os_battery_010_map[] = {
0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/
0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/
0x04, 0x7a, 0xf4, 0xff, /*Color of index 2*/
0xe4, 0xe6, 0xe4, 0xff, /*Color of index 3*/
0x55, 0x5f, 0xff, 0xff, 0xf5, 0x55, 0x55,
0x55, 0x7f, 0xff, 0xff, 0xfd, 0x55, 0x55,
0x55, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55,
0x55, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55,
0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55,
0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55,
0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55,
0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55,
0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55,
0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55,
0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55,
0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55,
0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55,
0xff, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55,
0xff, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0xff, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0xff, 0x55, 0x55, 0x6a, 0xaa, 0xaa, 0xa9,
0xff, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa,
0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa,
0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa,
0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa,
0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa,
0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa,
0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa,
0xff, 0x50, 0x05, 0xaa, 0xaa, 0xaa, 0xaa,
0xff, 0x50, 0x05, 0xaa, 0xaa, 0xaa, 0xaa,
0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa,
0xff, 0x55, 0x55, 0xaa, 0xa5, 0x5a, 0xaa,
0xff, 0xff, 0xf5, 0xaa, 0xa5, 0x5a, 0xaa,
0xff, 0xff, 0xf5, 0xaa, 0xa5, 0x5a, 0xaa,
0xff, 0xff, 0xf5, 0xaa, 0xaa, 0xaa, 0xaa,
0xff, 0xff, 0xf5, 0x6a, 0xaa, 0xaa, 0xa9,
};
const lv_img_dsc_t ck_os_battery_010 = {
.header.always_zero = 0,
.header.w = 28,
.header.h = 32,
.data_size = 240,
.header.cf = LV_IMG_CF_INDEXED_2BIT,
.data = ck_os_battery_010_map,
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,58 @@
#include "lvgl/lvgl.h"
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_CK_OS_BATTERY_020
#define LV_ATTRIBUTE_IMG_CK_OS_BATTERY_020
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_CK_OS_BATTERY_020 uint8_t ck_os_battery_020_map[] = {
0x04, 0x02, 0xcc, 0xff, /*Color of index 0*/
0x6c, 0xfe, 0x6c, 0xff, /*Color of index 1*/
0xe4, 0xe6, 0xe4, 0xff, /*Color of index 2*/
0xff, 0xff, 0xff, 0xff, /*Color of index 3*/
0x55, 0x5a, 0xaa, 0xaa, 0xa5, 0x55,
0x55, 0x6a, 0xaa, 0xaa, 0xa9, 0x55,
0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55,
0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0x55,
0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa,
0xaa, 0x50, 0x00, 0x00, 0x05, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0x55, 0x55, 0x55, 0x55, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
};
const lv_img_dsc_t ck_os_battery_020 = {
.header.always_zero = 0,
.header.w = 24,
.header.h = 32,
.data_size = 208,
.header.cf = LV_IMG_CF_INDEXED_2BIT,
.data = ck_os_battery_020_map,
};

Some files were not shown because too many files have changed in this diff Show More