Skip to content

Commit ee2afce

Browse files
committed
Merge branch 'develop'
2 parents 4cebcb2 + aeb424f commit ee2afce

63 files changed

Lines changed: 1572 additions & 851 deletions

Some content is hidden

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

.github/workflows/doxygen-gh-pages.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Deploy Doxygen document on GitHub Pages
2-
on: [release, workflow_dispatch]
3-
#branches:
4-
# - main
5-
# - master
2+
on:
3+
release:
4+
types: [published]
5+
workflow_dispatch:
66
permissions:
77
contents: write
88
defaults:
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
name: Build(esp-idf-native)
2+
3+
on:
4+
push:
5+
tags-ignore:
6+
- '*.*.*'
7+
- 'v*.*.*'
8+
branches:
9+
- '*'
10+
paths:
11+
- 'src/**.cpp'
12+
- 'src/**.hpp'
13+
- 'src/**.h'
14+
- 'src/**.c'
15+
- 'CMakeLists.txt'
16+
- 'idf_component.yml'
17+
- 'examples/UnitUnified/**.cpp'
18+
- 'examples/UnitUnified/**.hpp'
19+
- 'examples/UnitUnified/**.h'
20+
- 'examples/UnitUnified/**.c'
21+
- 'examples/UnitUnified/**/CMakeLists.txt'
22+
- 'examples/UnitUnified/**/Kconfig.projbuild'
23+
- 'examples/UnitUnified/common/**'
24+
- '.github/workflows/esp-idf-build-check.yml'
25+
pull_request:
26+
paths:
27+
- 'src/**.cpp'
28+
- 'src/**.hpp'
29+
- 'src/**.h'
30+
- 'src/**.c'
31+
- 'CMakeLists.txt'
32+
- 'idf_component.yml'
33+
- 'examples/UnitUnified/**.cpp'
34+
- 'examples/UnitUnified/**.hpp'
35+
- 'examples/UnitUnified/**.h'
36+
- 'examples/UnitUnified/**.c'
37+
- 'examples/UnitUnified/**/CMakeLists.txt'
38+
- 'examples/UnitUnified/**/Kconfig.projbuild'
39+
- 'examples/UnitUnified/common/**'
40+
- '.github/workflows/esp-idf-build-check.yml'
41+
workflow_dispatch:
42+
43+
defaults:
44+
run:
45+
shell: bash
46+
47+
concurrency:
48+
group: ${{ github.workflow }}-${{ github.ref }}
49+
cancel-in-progress: true
50+
51+
# Cross design: variant coverage on esp32s3, chip coverage on the other SoCs with the default
52+
# UART variant (UnitFinger). UnitFinger PlotToSerial gets all three FPC1020A wirings
53+
# (Unit / Hat / Faces); the other UnitFinger examples compile with the default variant only.
54+
# UnitFinger2 has a single unit/wiring variant (no Kconfig choice), so its examples build
55+
# without a variant selection and only on esp32s3 — the FPC1020A chip job covers the SoCs.
56+
jobs:
57+
# Variant coverage: every example / wiring variant on esp32s3 (LCD-capable dual-core Xtensa with PSRAM).
58+
build-variants:
59+
name: ${{ matrix.idf }} esp32s3 ${{ matrix.example_config.label }}
60+
runs-on: ubuntu-latest
61+
timeout-minutes: 30
62+
strategy:
63+
fail-fast: false
64+
max-parallel: 20
65+
matrix:
66+
# idf boundaries: 5.1.7 = oldest legacy-driver (5.0.x dropped: M5GFX needs esp_mm added
67+
# in 5.1), 5.4.4 = new driver/*_master.h + touch_sens.h era, 5.5.4 = latest.
68+
idf: [v5.1.7, v5.4.4, v5.5.4]
69+
# Cross design: PlotToSerial gets all three FPC1020A variants — primary example.
70+
# Capture / Characteristic / User compile with the default UnitFinger variant only.
71+
example_config:
72+
- label: UnitFinger-PlotToSerial-Unit (full)
73+
example_path: examples/UnitUnified/UnitFinger/PlotToSerial
74+
variant: USING_UNIT_FINGER
75+
- label: UnitFinger-PlotToSerial-Hat (full)
76+
example_path: examples/UnitUnified/UnitFinger/PlotToSerial
77+
variant: USING_HAT_FINGER
78+
- label: UnitFinger-PlotToSerial-Faces (full)
79+
example_path: examples/UnitUnified/UnitFinger/PlotToSerial
80+
variant: USING_FACES_FINGER
81+
- label: UnitFinger-Capture-Unit
82+
example_path: examples/UnitUnified/UnitFinger/Capture
83+
variant: USING_UNIT_FINGER
84+
- label: UnitFinger-Characteristic-Unit
85+
example_path: examples/UnitUnified/UnitFinger/Characteristic
86+
variant: USING_UNIT_FINGER
87+
- label: UnitFinger-User-Unit
88+
example_path: examples/UnitUnified/UnitFinger/User
89+
variant: USING_UNIT_FINGER
90+
- label: UnitFinger2-PlotToSerial
91+
example_path: examples/UnitUnified/UnitFinger2/PlotToSerial
92+
variant: ''
93+
- label: UnitFinger2-Automatic
94+
example_path: examples/UnitUnified/UnitFinger2/Automatic
95+
variant: ''
96+
- label: UnitFinger2-Capture
97+
example_path: examples/UnitUnified/UnitFinger2/Capture
98+
variant: ''
99+
- label: UnitFinger2-User
100+
example_path: examples/UnitUnified/UnitFinger2/User
101+
variant: ''
102+
steps:
103+
- name: Checkout
104+
uses: actions/checkout@v4
105+
106+
- name: Select Kconfig variant
107+
# The example's own sdkconfig.defaults is not read (top CMakeLists points SDKCONFIG_DEFAULTS
108+
# at common/sdkconfig.defaults). Append the choice to common/ in the CI workspace only.
109+
# UnitFinger2 has no variant choice, so the step is skipped for its examples.
110+
if: matrix.example_config.variant != ''
111+
run: |
112+
echo "" >> examples/UnitUnified/common/sdkconfig.defaults
113+
echo "CONFIG_EXAMPLE_${{ matrix.example_config.variant }}=y" >> examples/UnitUnified/common/sdkconfig.defaults
114+
115+
- name: ESP-IDF build
116+
uses: espressif/esp-idf-ci-action@v1
117+
with:
118+
esp_idf_version: ${{ matrix.idf }}
119+
target: esp32s3
120+
path: ${{ matrix.example_config.example_path }}
121+
122+
# Chip coverage: UnitFinger PlotToSerial (default UART variant) on every other supported SoC.
123+
# esp32 = classic Xtensa dual-core (M5Unified touch-deprecation path). esp32c3 / esp32c6 /
124+
# esp32h2 = RISC-V single-core, exercises the app_main CONFIG_FREERTOS_UNICORE feedIdle branch.
125+
# esp32p4 (M5Stack Tab5) = RISC-V dual-core; sdkconfig.defaults.esp32p4 overlay
126+
# (chip-rev minimum keys) is auto-applied.
127+
build-chips:
128+
name: ${{ matrix.idf }} ${{ matrix.target }} UnitFinger-PlotToSerial-Unit
129+
runs-on: ubuntu-latest
130+
timeout-minutes: 30
131+
strategy:
132+
fail-fast: false
133+
max-parallel: 20
134+
matrix:
135+
target: [esp32, esp32c3, esp32c6, esp32h2, esp32p4]
136+
idf: [v5.1.7, v5.4.4, v5.5.4]
137+
exclude:
138+
# esp32p4 stable from IDF v5.3 (M5GFX P4 verified on 5.4/5.5). 5.1.7 not applicable.
139+
- target: esp32p4
140+
idf: v5.1.7
141+
steps:
142+
- name: Checkout
143+
uses: actions/checkout@v4
144+
145+
- name: Select Kconfig variant
146+
run: |
147+
echo "" >> examples/UnitUnified/common/sdkconfig.defaults
148+
echo "CONFIG_EXAMPLE_USING_UNIT_FINGER=y" >> examples/UnitUnified/common/sdkconfig.defaults
149+
150+
- name: ESP-IDF build
151+
uses: espressif/esp-idf-ci-action@v1
152+
with:
153+
esp_idf_version: ${{ matrix.idf }}
154+
target: ${{ matrix.target }}
155+
path: examples/UnitUnified/UnitFinger/PlotToSerial

.github/workflows/platformio-build-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
- AtomS3
7373
- AtomS3R
7474
- NanoC6
75+
- NanoH2
7576
- StickCPlus
7677
- StickCPlus2
7778
- StickS3

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,18 @@ build/
3939
cmake-build-*/
4040
managed_components/
4141

42+
# ESP-IDF (idf.py) build artifacts
43+
sdkconfig
44+
sdkconfig.old
45+
dependencies.lock
46+
4247
# PlatformIO
4348
.pio/
4449

4550
# VSCode
4651
.vscode/
4752
.cache/
53+
.clangd
4854

4955
# Python virtual environment
5056
.venv/

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ESP-IDF component manifest for M5Unit-FINGER.
2+
# Upstream: https://github.com/m5stack/M5Unit-FINGER
3+
#
4+
# UnitFPC1020A (UnitFinger / HatFinger / FacesFinger) and UnitFinger2 over UART.
5+
# FacesFinger drives the M-Bus panel/touch power pins via the ESP-IDF native driver/gpio API.
6+
file(GLOB_RECURSE SRCS "src/*.cpp")
7+
idf_component_register(
8+
SRCS ${SRCS}
9+
INCLUDE_DIRS "src"
10+
REQUIRES M5UnitUnified
11+
PRIV_REQUIRES M5Utility driver
12+
)

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,29 @@ You must choose a define symbol for the unit you will use.
6161
#endif
6262
```
6363

64+
### For ESP-IDF settings
65+
The examples also build as native ESP-IDF projects (`idf.py`). Each example directory is a standalone project that pulls in this library together with `M5UnitUnified` / `M5Unified` via `main/idf_component.yml`.
66+
67+
```sh
68+
cd examples/UnitUnified/UnitFinger/Capture # or any example
69+
idf.py set-target esp32s3 # or esp32 / esp32c6 / esp32p4 / ...
70+
idf.py menuconfig # UnitFinger family only (see below)
71+
idf.py build flash monitor
72+
```
73+
74+
For the **UnitFinger family** (FPC1020A: UnitFinger / HatFinger / FacesFinger) the unit/board is selected via Kconfig instead of editing the source `#define`. Each example exposes the same choice through `main/Kconfig.projbuild` (which sources `examples/UnitUnified/common/Kconfig.variant`), and `examples/UnitUnified/common/variant.cmake` maps the chosen `CONFIG_EXAMPLE_USING_*` to the source-level `USING_*` macro shared with the Arduino build:
75+
76+
```
77+
# -> M5Unit-FINGER example -> Target unit / board -> choose ONE:
78+
# UnitFinger (FPC1020A, UART / GROVE PortC)
79+
# HatFinger (FPC1020A, UART / HAT)
80+
# FacesFinger (FPC1020A, UART / M-Bus)
81+
```
82+
83+
The **UnitFinger2** examples drive a single unit over UART and have no variant choice, so no `menuconfig` selection is needed.
84+
85+
**ESP32-P4 / M5Tab5:** early P4 silicon (M5Tab5 reports revision v1.0) is rejected by the IDF v5.5+ default minimum chip revision (v3.1), so flashing fails with `bootloader.bin requires chip revision in range [v3.1 - v3.99]`. `examples/UnitUnified/common/sdkconfig.defaults.esp32p4` lowers the minimum so every P4 revision boots; it is applied automatically when the target is `esp32p4`.
86+
6487
## Doxygen document
6588
[GitHub Pages](https://m5stack.github.io/M5Unit-FINGER/)
6689

@@ -75,7 +98,6 @@ If you want to output Git commit hashes to html, do it for the git cloned folder
7598

7699
### Required
77100
- [Doxygen](https://www.doxygen.nl/)
78-
- [pcregrep](https://formulae.brew.sh/formula/pcre2)
79101
- [Git](https://git-scm.com/) (Output commit hash to html)
80102

81103

boards/m5stack-nanoc6.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"build": {
33
"core": "esp32",
44
"extra_flags": [
5-
"-DARDUINO_M5STACK_NANOC6"
5+
"-DARDUINO_M5STACK_NANO_C6"
66
],
77
"f_cpu": "160000000L",
88
"f_flash": "80000000L",

boards/m5stack-nanoh2.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"build": {
3+
"core": "esp32",
4+
"extra_flags": [
5+
"-DARDUINO_M5STACK_NANO_H2"
6+
],
7+
"f_cpu": "96000000L",
8+
"f_flash": "16000000L",
9+
"flash_mode": "qio",
10+
"mcu": "esp32h2",
11+
"variant": "esp32h2"
12+
},
13+
"connectivity": [
14+
"bluetooth"
15+
],
16+
"debug": {
17+
"openocd_target": "esp32h2.cfg"
18+
},
19+
"frameworks": [
20+
"arduino",
21+
"espidf"
22+
],
23+
"name": "M5Stack NanoH2",
24+
"upload": {
25+
"flash_size": "4MB",
26+
"maximum_ram_size": 327680,
27+
"maximum_size": 4194304,
28+
"require_upload_port": true,
29+
"speed": 460800
30+
},
31+
"url": "https://docs.m5stack.com/en/core/M5NanoH2",
32+
"vendor": "M5Stack"
33+
}

docs/doxy.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
## Get version from library.properties
66
## Get git rev of HEAD
7-
LIB_VERSION="$(pcregrep -o1 "^\s*version\s*=\s*(\*|\d+(\.\d+){0,3}(\.\*)?)" library.properties)"
7+
LIB_VERSION="$(grep -E '^[[:space:]]*version[[:space:]]*=' library.properties | head -n1 | cut -d'=' -f2 | tr -d '[:space:]')"
88
#echo ${DOXYGEN_PROJECT_NUMBER}
9-
DOXYGEN_PROJECT_NUMBER="${LIB_VERSION} git rev:$(git rev-parse --short HEAD)" doxygen docs/Doxyfile
10-
11-
9+
GIT_REV="$(git rev-parse --short HEAD 2>/dev/null)"
10+
DOXYGEN_PROJECT_NUMBER="${LIB_VERSION}${GIT_REV:+ git rev:${GIT_REV}}" doxygen docs/Doxyfile
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ESP-IDF project for the UnitFinger Capture example (M5Unit-FINGER).
2+
# Build: idf.py set-target <esp32|esp32s3|...> && idf.py build
3+
cmake_minimum_required(VERSION 3.16.0)
4+
# Shared ESP-IDF defaults for all UnitUnified examples (CPU / tick / stack / core / flash / PSRAM).
5+
set(SDKCONFIG_DEFAULTS "${CMAKE_CURRENT_LIST_DIR}/../../common/sdkconfig.defaults")
6+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
7+
# M5 log level (E=1 / W=2 / I=3 / D=4 / V=5) for all components.
8+
idf_build_set_property(COMPILE_OPTIONS "-DM5_LOG_LEVEL=3" "-DCORE_DEBUG_LEVEL=3" APPEND)
9+
project(unitfinger-capture)

0 commit comments

Comments
 (0)