Skip to content

Commit 73f5542

Browse files
committed
Merge branch 'develop'
2 parents 39d7f12 + 804cdce commit 73f5542

15 files changed

+111
-92
lines changed
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
name: Arduino Lint Check
22
on:
33
push:
4-
branches: [ master ]
4+
branches: [ master, main ]
55
pull_request:
6-
branches: [ master ]
6+
branches: [ master, main ]
7+
workflow_dispatch:
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
717
jobs:
818
lint:
919
name: Lint Check
1020
runs-on: ubuntu-latest
1121
steps:
12-
- uses: actions/checkout@v2
13-
- uses: arduino/arduino-lint-action@v1
22+
- uses: actions/checkout@v4
23+
- uses: arduino/arduino-lint-action@v2
1424
with:
1525
library-manager: update
1626
compliance: strict
17-
project-type: all
27+
project-type: all

.github/workflows/arduino-esp-v2-build-check.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ on:
1616
- 'src/unit/**.hpp'
1717
- 'src/unit/**.h'
1818
- 'src/unit/**.c'
19-
- 'test/**.cpp'
20-
- 'test/**.hpp'
21-
- 'test/**.h'
22-
- 'test/**.c'
2319
- 'examples/UnitUnified/**.ino'
2420
- 'examples/UnitUnified/**.cpp'
2521
- 'examples/UnitUnified/**.hpp'
@@ -32,10 +28,6 @@ on:
3228
- 'src/unit/**.hpp'
3329
- 'src/unit/**.h'
3430
- 'src/unit/**.c'
35-
- 'test/**.cpp'
36-
- 'test/**.hpp'
37-
- 'test/**.h'
38-
- 'test/**.c'
3931
- 'examples/UnitUnified/**.ino'
4032
- 'examples/UnitUnified/**.cpp'
4133
- 'examples/UnitUnified/**.hpp'
@@ -44,10 +36,19 @@ on:
4436
- '**arduino-esp-v2-build-check.yml'
4537
workflow_dispatch:
4638

39+
defaults:
40+
run:
41+
shell: bash
42+
43+
concurrency:
44+
group: ${{ github.workflow }}-${{ github.ref }}
45+
cancel-in-progress: true
46+
4747
jobs:
4848
build:
4949
name: ${{ matrix.unit }}:${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}}
5050
runs-on: ubuntu-latest
51+
timeout-minutes: 5
5152

5253
strategy:
5354
fail-fast: false
@@ -59,8 +60,8 @@ jobs:
5960
sketch:
6061
- PlotToSerial
6162

62-
unit:
63-
- ''
63+
# unit:
64+
# - UnitGesture
6465

6566
board:
6667
- m5stack-atom

.github/workflows/arduino-esp-v3-build-check.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ on:
1616
- 'src/unit/**.hpp'
1717
- 'src/unit/**.h'
1818
- 'src/unit/**.c'
19-
- 'test/**.cpp'
20-
- 'test/**.hpp'
21-
- 'test/**.h'
22-
- 'test/**.c'
2319
- 'examples/UnitUnified/**.ino'
2420
- 'examples/UnitUnified/**.cpp'
2521
- 'examples/UnitUnified/**.hpp'
@@ -32,10 +28,6 @@ on:
3228
- 'src/unit/**.hpp'
3329
- 'src/unit/**.h'
3430
- 'src/unit/**.c'
35-
- 'test/**.cpp'
36-
- 'test/**.hpp'
37-
- 'test/**.h'
38-
- 'test/**.c'
3931
- 'examples/UnitUnified/**.ino'
4032
- 'examples/UnitUnified/**.cpp'
4133
- 'examples/UnitUnified/**.hpp'
@@ -44,10 +36,19 @@ on:
4436
- '**arduino-esp-v3-build-check.yml'
4537
workflow_dispatch:
4638

39+
defaults:
40+
run:
41+
shell: bash
42+
43+
concurrency:
44+
group: ${{ github.workflow }}-${{ github.ref }}
45+
cancel-in-progress: true
46+
4747
jobs:
4848
build:
4949
name: ${{ matrix.unit }}:${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}}
5050
runs-on: ubuntu-latest
51+
timeout-minutes: 5
5152

5253
strategy:
5354
fail-fast: false
@@ -59,8 +60,8 @@ jobs:
5960
sketch:
6061
- PlotToSerial
6162

62-
unit:
63-
- ''
63+
# unit:
64+
# - UnitGesture
6465

6566
board:
6667
- m5stack_atom

.github/workflows/arduino-m5-build-check.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ on:
1616
- 'src/unit/**.hpp'
1717
- 'src/unit/**.h'
1818
- 'src/unit/**.c'
19-
- 'test/**.cpp'
20-
- 'test/**.hpp'
21-
- 'test/**.h'
22-
- 'test/**.c'
2319
- 'examples/UnitUnified/**.ino'
2420
- 'examples/UnitUnified/**.cpp'
2521
- 'examples/UnitUnified/**.hpp'
@@ -32,10 +28,6 @@ on:
3228
- 'src/unit/**.hpp'
3329
- 'src/unit/**.h'
3430
- 'src/unit/**.c'
35-
- 'test/**.cpp'
36-
- 'test/**.hpp'
37-
- 'test/**.h'
38-
- 'test/**.c'
3931
- 'examples/UnitUnified/**.ino'
4032
- 'examples/UnitUnified/**.cpp'
4133
- 'examples/UnitUnified/**.hpp'
@@ -44,10 +36,19 @@ on:
4436
- '**arduino-m5-build-check.yml'
4537
workflow_dispatch:
4638

39+
defaults:
40+
run:
41+
shell: bash
42+
43+
concurrency:
44+
group: ${{ github.workflow }}-${{ github.ref }}
45+
cancel-in-progress: true
46+
4747
jobs:
4848
build:
4949
name: ${{ matrix.unit }}:${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}}
5050
runs-on: ubuntu-latest
51+
timeout-minutes: 5
5152

5253
strategy:
5354
fail-fast: false
@@ -59,8 +60,8 @@ jobs:
5960
sketch:
6061
- PlotToSerial
6162

62-
unit:
63-
- ''
63+
# unit:
64+
# - UnitGesture
6465

6566
board:
6667
- m5stack_atom

.github/workflows/clang-format-check.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ on:
3131
- '**.clang-format'
3232
workflow_dispatch:
3333

34+
defaults:
35+
run:
36+
shell: bash
37+
38+
concurrency:
39+
group: ${{ github.workflow }}-${{ github.ref }}
40+
cancel-in-progress: true
41+
3442
jobs:
3543
formatting-check:
3644
name: Formatting Check

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ on: [release, workflow_dispatch]
33
# branches:
44
# - main
55
# - master
6+
defaults:
7+
run:
8+
shell: bash
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
614
jobs:
715
deploy:
816
runs-on: ubuntu-latest

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ on:
1212
- 'src/unit/**.hpp'
1313
- 'src/unit/**.h'
1414
- 'src/unit/**.c'
15-
- 'test/**.cpp'
16-
- 'test/**.hpp'
17-
- 'test/**.h'
18-
- 'test/**.c'
1915
- 'examples/UnitUnified/**.ino'
2016
- 'examples/UnitUnified/**.cpp'
2117
- 'examples/UnitUnified/**.hpp'
@@ -29,10 +25,6 @@ on:
2925
- 'src/unit/**.hpp'
3026
- 'src/unit/**.h'
3127
- 'src/unit/**.c'
32-
- 'test/**.cpp'
33-
- 'test/**.hpp'
34-
- 'test/**.h'
35-
- 'test/**.c'
3628
- 'examples/UnitUnified/**.ino'
3729
- 'examples/UnitUnified/**.cpp'
3830
- 'examples/UnitUnified/**.hpp'
@@ -42,10 +34,19 @@ on:
4234
- '**platformio.ini'
4335
workflow_dispatch:
4436

37+
defaults:
38+
run:
39+
shell: bash
40+
41+
concurrency:
42+
group: ${{ github.workflow }}-${{ github.ref }}
43+
cancel-in-progress: true
44+
4545
jobs:
4646
build:
4747
name: ${{ matrix.unit }}:${{ matrix.example }}@${{ matrix.board }}:${{ matrix.framework }}:${{ matrix.espressif32 }}
4848
runs-on: ubuntu-latest
49+
timeout-minutes: 5
4950

5051
strategy:
5152
fail-fast: false
@@ -55,8 +56,8 @@ jobs:
5556
example:
5657
- PlotToSerial
5758

58-
unit:
59-
- ''
59+
# unit:
60+
# - UnitGesture
6061

6162
board:
6263
- Core

examples/UnitUnified/BLEKeyboard/main/BLEKeyboard.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace {
2424
auto& lcd = M5.Display;
2525

2626
m5::unit::UnitUnified Units;
27-
m5::unit::UnitGESTURE unit;
27+
m5::unit::UnitGesture unit;
2828

2929
BleKeyboard bleKeyboard{"PagerKB", "M5UU", 100};
3030
unsigned long inactive_to{};
@@ -105,7 +105,7 @@ void loop()
105105
Units.update();
106106
if (connected != bleKeyboard.isConnected()) {
107107
connected = bleKeyboard.isConnected();
108-
M5_LOGW("Change BLE connection:%u", connected);
108+
M5.Log.printf("Change BLE connection:%u\n", connected);
109109
lcd.clear(connected ? TFT_DARKGREEN : TFT_DARKGRAY);
110110
}
111111
if (connected) {
@@ -120,7 +120,7 @@ void loop()
120120
if (unit.updated()) {
121121
auto key = gesture_to_key(unit.gesture());
122122
if (key) {
123-
M5_LOGI("Send %x by %s", key, gesture_to_string(unit.gesture()));
123+
M5.Log.printf("Send %x by %s\n", key, gesture_to_string(unit.gesture()));
124124
bleKeyboard.write(key);
125125
// Continuous input prevention period
126126
inactive_to = m5::utility::millis() + INACTIVE_TIME;

examples/UnitUnified/PlotToSerial/main/PlotToSerial.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace {
1515
auto& lcd = M5.Display;
1616

1717
m5::unit::UnitUnified Units;
18-
m5::unit::UnitGESTURE unit;
18+
m5::unit::UnitGesture unit;
1919

2020
using gesture_t = m5::unit::paj7620u2::Gesture;
2121

@@ -111,7 +111,9 @@ void setup()
111111
void loop()
112112
{
113113
M5.update();
114+
auto touch = M5.Touch.getDetail();
114115
Units.update();
116+
115117
switch (unit.mode()) {
116118
case m5::unit::paj7620u2::Mode::Gesture: {
117119
static uint8_t noobj{};
@@ -124,38 +126,39 @@ void loop()
124126
unit.readObjectSize(size);
125127
unit.readObjectCenter(x, y);
126128

127-
M5_LOGI("Gesture:%s noobject:%u nomotion:%u size:%u (%u,%u)", gesture_to_string(unit.gesture()), noobj,
128-
nomot, size, x, y);
129+
M5.Log.printf("Gesture:%s noobject:%u nomotion:%u size:%u (%u,%u)\n", gesture_to_string(unit.gesture()),
130+
noobj, nomot, size, x, y);
129131
}
130132
unit.readNoObjectCount(noobj);
131133

132134
static Corner pc{};
133135
Corner c = detectCorner();
134136
if (c != pc) {
135-
M5_LOGI("Obj:%s", cstr[(uint8_t)c]);
137+
M5.Log.printf("Obj:%s\n", cstr[(uint8_t)c]);
136138
pc = c;
137139
}
138140
} break;
139141
case m5::unit::paj7620u2::Mode::Proximity: {
140142
if (unit.updated()) {
141-
M5_LOGI("%s brightness:%u approch:%u", gesture_to_string(unit.gesture()), unit.brightness(),
142-
unit.approach());
143+
M5.Log.printf("%s brightness:%u approch:%u\n", gesture_to_string(unit.gesture()), unit.brightness(),
144+
unit.approach());
143145
}
144146
} break;
145147
case m5::unit::paj7620u2::Mode::Cursor: {
146148
if (unit.updated()) {
147-
M5_LOGI("Cursor:%u,%u", unit.cursorX(), unit.cursorY());
149+
M5.Log.printf("Cursor:%u,%u\n", unit.cursorX(), unit.cursorY());
148150
}
149151
delay(100);
150152
} break;
151153
default:
152154
break;
153155
}
154-
if (M5.BtnA.wasClicked()) {
156+
157+
if (M5.BtnA.wasClicked() || touch.wasClicked()) {
155158
auto prev = detection;
156159
++detection;
157160
if (unit.writeMode(detection)) {
158-
M5_LOGI(">>> writeNMode %x", detection);
161+
M5.Log.printf(">> writeNMode %x\n", detection);
159162
switch (unit.mode()) {
160163
case m5::unit::paj7620u2::Mode::Gesture:
161164
unit.writeFrequency(Frequency::Gaming);

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"url": "https://github.com/m5stack/M5Unit-GESTURE.git"
1212
},
1313
"dependencies": {
14-
"M5UnitUnified": "https://github.com/m5stack/M5UnitUnified.git"
14+
"m5stack/M5UnitUnified": ">=0.1.0"
1515
},
16-
"version": "0.0.2",
16+
"version": "0.1.0",
1717
"frameworks": [
1818
"arduino"
1919
],

0 commit comments

Comments
 (0)