Skip to content

Commit a353e8c

Browse files
committed
Merge branch 'develop'
2 parents 3681541 + 6b98b1a commit a353e8c

File tree

16 files changed

+328
-91
lines changed

16 files changed

+328
-91
lines changed

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

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ env:
55

66
on:
77
push:
8+
tags-ignore:
9+
- '*.*.*'
10+
- 'v*.*.*'
11+
branches:
12+
- '*'
813
paths:
914
- '**.ino'
1015
- '**.cpp'
@@ -13,14 +18,18 @@ on:
1318
- '**.c'
1419
- '**.inl'
1520
- '**clang-format-check.yml'
16-
pull_request:
21+
- '**.clang-format'
22+
pull_request:
23+
paths:
1724
- '**.ino'
1825
- '**.cpp'
1926
- '**.hpp'
2027
- '**.h'
2128
- '**.c'
2229
- '**.inl'
2330
- '**clang-format-check.yml'
31+
- '**.clang-format'
32+
workflow_dispatch:
2433

2534
jobs:
2635
formatting-check:
@@ -29,12 +38,12 @@ jobs:
2938
strategy:
3039
matrix:
3140
path:
32-
#- check: './' # path to include
33-
# exclude: '' # path to exclude
3441
- check: 'src'
42+
exclude: ''
3543
- check: 'test'
36-
- check: 'examples'
37-
# exclude: '(Fonts)' # Exclude file paths containing "Fonts"
44+
exclude: ''
45+
- check: 'examples/Basic'
46+
exclude: ''
3847

3948
steps:
4049
- name: Checkout
@@ -49,3 +58,4 @@ jobs:
4958
check-path: ${{ matrix.path['check'] }}
5059
exclude-regex: ${{ matrix.path['exclude'] }}
5160
include-regex: ${{ env.INCLUDE_REGEX }}
61+

README.ja.md

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,37 @@ ESP-IDF は将来対応予定です。
100100
GPIO、UART は将来対応予定です。
101101

102102

103-
### サポートされる Core デバイス (動作確認済)
104-
- M5Stack Core (BASIC / GRAY / FIRE)
105-
- M5Stack Core2
106-
- M5Stick CPlus
107-
- M5Paper
108-
- M5Stack CoreS3 CoreS3SE
109-
- M5ATOMS3
110-
- M5STAMPS3
111-
- M5Dial
112-
- M5Capsule
113-
- M5NanoC6
103+
### サポートされるデバイス (動作確認済)
104+
こちらを参照 https://docs.m5stack.com/en/products
105+
106+
- CORE
107+
- [BASIC](https://docs.m5stack.com/en/core/basic)
108+
- [2.6](https://docs.m5stack.com/en/core/BASIC%20v2.6)
109+
- [GRAY](https://docs.m5stack.com/en/core/gray)
110+
- [Core2](https://docs.m5stack.com/en/core/core2)
111+
- [For AWS](https://docs.m5stack.com/en/core/core2_for_aws)
112+
- [v.1.1](https://docs.m5stack.com/en/core/Core2%20v1.1)
113+
- [CoreS3](https://docs.m5stack.com/en/core/CoreS3)
114+
- [CoreS3 SE](https://docs.m5stack.com/en/core/M5CoreS3%20SE)
115+
- [FIRE](https://docs.m5stack.com/en/core/fire)
116+
- [v2.6](https://docs.m5stack.com/en/core/fire_v2.6)
117+
- [M5Dial](https://docs.m5stack.com/en/core/M5Dial)
118+
- [M5Capsule](https://docs.m5stack.com/en/core/M5Capsule)
119+
- [M5DinMeter](https://docs.m5stack.com/en/core/M5DinMeter)
120+
- [M5NanoC6](https://docs.m5stack.com/en/core/M5NanoC6)
121+
- STICK
122+
- [M5Stick CPlus](https://docs.m5stack.com/en/core/m5stickc_plus)
123+
- [M5Stick CPlus2](https://docs.m5stack.com/en/core/M5StickC%20PLUS2)
124+
- ATOM
125+
- [ATOM Matrix](https://docs.m5stack.com/en/core/ATOM%20Matrix)
126+
- [AtomS3](https://docs.m5stack.com/en/core/AtomS3)
127+
- [AtomS3R](https://docs.m5stack.com/en/core/AtomS3R)
128+
- [AtomS3R Cam](https://docs.m5stack.com/en/core/AtomS3R%20Cam)
129+
- STAMP
130+
- [StampS3](https://docs.m5stack.com/en/core/StampS3)
131+
- E-PAPER
132+
- [CORE.INK](https://docs.m5stack.com/en/core/coreink)
133+
- [M5PAPER](https://docs.m5stack.com/en/core/m5paper)
114134

115135
他のデバイスは動作確認されたのち追加されます。
116136

@@ -121,7 +141,7 @@ GPIO、UART は将来対応予定です。
121141
- UnitCO2
122142
- UnitENVIII
123143
- UnitTVOC
124-
- UnitENVPro (いくつか問題があり修正中)
144+
- UnitENVPro
125145
- [M5Unit-METER](https://github.com/m5stack/M5Unit-METER)
126146
- UnitAmeter
127147
- UnitVmeter
@@ -132,16 +152,24 @@ GPIO、UART は将来対応予定です。
132152
- UnitGESTURE
133153
- [M5Unit-HEART](https://github.com/m5stack/M5Unit-HEART)
134154
- UnitHEART
155+
- [M5Unit-TOF](https://github.com/m5stack/M5Unit-TOF)
156+
- UnitToF
157+
- UnitToF4M
158+
- [M5Unit-WEIGHT](https://github.com/m5stack/M5Unit-WEIGHT)
159+
- UnitWeightI2C
135160

136161
他のユニットは開発、確認後追加されます。
137162

138163

139164
## Examples
140165
各ユニットのサンプルについては、各ユニットのリポジトリを参照してください。
141-
このリポジトリにあるサンプルはM5UnitUnified全般のものです
166+
[このリポジトリにあるサンプル](examples/Basic)は M5UnitUnified 全般のものです
142167

143168

144169
## Doxygen ドキュメント
170+
171+
[GitHub Pages](https://m5stack.github.io/M5UnitUnified/)
172+
145173
あなたのローカルマシンでドキュメントを生成したい場合は、以下のコマンドを実行してください。
146174
```
147175
bash docs/doxy.sh

README.md

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,37 @@ Support ESP-IDF with M5HAL in the future.
101101

102102
Support GPIO, UART in the future.
103103

104-
### Supported core device (Operation confirmed)
105-
106-
- M5Stack Core (BASIC / GRAY / FIRE)
107-
- M5Stack Core2
108-
- M5Stick CPlus
109-
- M5Paper
110-
- M5Stack CoreS3 CoreS3SE
111-
- M5ATOMS3
112-
- M5STAMPS3
113-
- M5Dial
114-
- M5Capsule
115-
- M5NanoC6
104+
### Supported devices (Operation confirmed)
105+
See also https://docs.m5stack.com/en/products
106+
107+
- CORE
108+
- [BASIC](https://docs.m5stack.com/en/core/basic)
109+
- [2.6](https://docs.m5stack.com/en/core/BASIC%20v2.6)
110+
- [GRAY](https://docs.m5stack.com/en/core/gray)
111+
- [Core2](https://docs.m5stack.com/en/core/core2)
112+
- [For AWS](https://docs.m5stack.com/en/core/core2_for_aws)
113+
- [v.1.1](https://docs.m5stack.com/en/core/Core2%20v1.1)
114+
- [CoreS3](https://docs.m5stack.com/en/core/CoreS3)
115+
- [CoreS3 SE](https://docs.m5stack.com/en/core/M5CoreS3%20SE)
116+
- [FIRE](https://docs.m5stack.com/en/core/fire)
117+
- [v2.6](https://docs.m5stack.com/en/core/fire_v2.6)
118+
- [M5Dial](https://docs.m5stack.com/en/core/M5Dial)
119+
- [M5Capsule](https://docs.m5stack.com/en/core/M5Capsule)
120+
- [M5DinMeter](https://docs.m5stack.com/en/core/M5DinMeter)
121+
- [M5NanoC6](https://docs.m5stack.com/en/core/M5NanoC6)
122+
- STICK
123+
- [M5Stick CPlus](https://docs.m5stack.com/en/core/m5stickc_plus)
124+
- [M5Stick CPlus2](https://docs.m5stack.com/en/core/M5StickC%20PLUS2)
125+
- ATOM
126+
- [ATOM Matrix](https://docs.m5stack.com/en/core/ATOM%20Matrix)
127+
- [AtomS3](https://docs.m5stack.com/en/core/AtomS3)
128+
- [AtomS3R](https://docs.m5stack.com/en/core/AtomS3R)
129+
- [AtomS3R Cam](https://docs.m5stack.com/en/core/AtomS3R%20Cam)
130+
- STAMP
131+
- [StampS3](https://docs.m5stack.com/en/core/StampS3)
132+
- E-PAPER
133+
- [CORE.INK](https://docs.m5stack.com/en/core/coreink)
134+
- [M5PAPER](https://docs.m5stack.com/en/core/m5paper)
116135

117136
Other devices will be added after confirmation of operation.
118137

@@ -124,7 +143,7 @@ Other devices will be added after confirmation of operation.
124143
- UnitCO2
125144
- UnitENVIII
126145
- UnitTVOC
127-
- UnitENVPro (There are a few problems)
146+
- UnitENVPro
128147
- [M5Unit-METER](https://github.com/m5stack/M5Unit-METER)
129148
- UnitAmeter
130149
- UnitVmeter
@@ -135,15 +154,23 @@ Other devices will be added after confirmation of operation.
135154
- UnitGESTURE
136155
- [M5Unit-HEART](https://github.com/m5stack/M5Unit-HEART)
137156
- UnitHEART
157+
- [M5Unit-TOF](https://github.com/m5stack/M5Unit-TOF)
158+
- UnitToF
159+
- UnitToF4M
160+
- [M5Unit-WEIGHT](https://github.com/m5stack/M5Unit-WEIGHT)
161+
- UnitWeightI2C
138162

139163
Other units will be added after they are developed and tested.
140164

141165
## Examples
142166
For exampless of each unit, please refer to the respective unit's repository.
143-
The examples in this repository are for M5UnitUnified in general
167+
[The examples in this repository](examples/Basic) are for M5UnitUnified in general
144168

145169

146170
## Doxygen document
171+
172+
[GitHub Pages](https://m5stack.github.io/M5UnitUnified/)
173+
147174
If you want to generate documents on your local machine, execute the following command
148175

149176
```

boards/m5stack-atoms3r.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"memory_type": "qio_opi",
5+
"ldscript": "esp32s3_out.ld",
6+
"partitions": "default_8MB.csv"
7+
},
8+
"core": "esp32",
9+
"extra_flags": [
10+
"-DARDUINO_M5STACK_ATOMS3R",
11+
"-DBOARD_HAS_PSRAM",
12+
"-DARDUINO_USB_MODE=1",
13+
"-DARDUINO_USB_CDC_ON_BOOT=1",
14+
"-DARDUINO_RUNNING_CORE=1",
15+
"-DARDUINO_EVENT_RUNNING_CORE=1"
16+
],
17+
"f_cpu": "240000000L",
18+
"f_flash": "80000000L",
19+
"flash_mode": "dio",
20+
"mcu": "esp32s3",
21+
"variant": "m5stack_atoms3"
22+
},
23+
"connectivity": [
24+
"bluetooth",
25+
"wifi"
26+
],
27+
"frameworks": [
28+
"arduino",
29+
"espidf"
30+
],
31+
"name": "M5Stack AtomS3R",
32+
"upload": {
33+
"flash_size": "8MB",
34+
"maximum_ram_size": 327680,
35+
"maximum_size": 8388608,
36+
"require_upload_port": true,
37+
"speed": 460800
38+
},
39+
"url": "https://docs.m5stack.com/en/core/AtomS3R",
40+
"vendor": "M5Stack"
41+
}

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_NANOC6"
66
],
77
"f_cpu": "160000000L",
88
"f_flash": "80000000L",

boards/m5stick-cplus2.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"build": {
3+
"arduino":{
4+
"ldscript": "esp32_out.ld",
5+
"partitions": "default_8MB.csv"
6+
},
7+
"core": "esp32",
8+
"extra_flags": [
9+
"-DM5STACK_M5STICK_CPLUS2",
10+
"-DBOARD_HAS_PSRAM",
11+
"-mfix-esp32-psram-cache-issue",
12+
"-mfix-esp32-psram-cache-strategy=memw",
13+
"-DARDUINO_RUNNING_CORE=1",
14+
"-DARDUINO_EVENT_RUNNING_CORE=1"
15+
],
16+
"f_cpu": "240000000L",
17+
"f_flash": "80000000L",
18+
"flash_mode": "dio",
19+
"mcu": "esp32",
20+
"variant": "m5stick_c"
21+
},
22+
"connectivity": [
23+
"wifi",
24+
"bluetooth"
25+
],
26+
"frameworks": [
27+
"arduino",
28+
"espidf"
29+
],
30+
"name": "M5Stick-CPlus2",
31+
"upload": {
32+
"flash_size": "8MB",
33+
"maximum_ram_size": 327680,
34+
"maximum_size": 8388608,
35+
"require_upload_port": true,
36+
"speed": 1500000
37+
},
38+
"url": "https://docs.m5stack.com/en/core/M5StickC%20PLUS2",
39+
"vendor": "M5Stack"
40+
}

examples/demo/MultipleUnits/main/MultipleUnits.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
#include <M5Unified.h>
1818
#include <M5UnitUnified.h>
1919
#include <M5UnitUnifiedHUB.h>
20-
#include <M5UnitUnifiedENV.h> // ENVIII
20+
#include <M5UnitUnifiedENV.h> // ENVIII,TVOC
2121
#include <M5UnitUnifiedMETER.h> // Vmeter
2222
#include <M5UnitUnifiedHEART.h> // HEART
23-
#include <M5UnitUnifiedTVOC.h> // TVOC
2423
#include <Wire.h>
2524
#if __has_include(<esp_idf_version.h>)
2625
#include <esp_idf_version.h>
@@ -124,7 +123,7 @@ void prepare()
124123
tvocSmallUI.construct();
125124
vmeterSmallUI.construct();
126125
env3SmallUI.construct();
127-
heartSmallUI.heartRate().setSampleRate(m5::max30100::HeartRate::getSampleRate(unitHeart.config().sample_rate));
126+
heartSmallUI.monitor().setSamplingRate(m5::unit::max30100::getSamplingRate(unitHeart.config().sampling_rate));
128127
}
129128

130129
// task for Vmeter

examples/demo/MultipleUnits/src/ui/ui_UnitHEART.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,15 @@ void UnitHEARTSmallUI::update()
5656

5757
lock();
5858
for (auto&& e : _intermediateBuffer) {
59-
beat(_heartRate.push_back(e.ir, e.red));
60-
_bpm = _heartRate.calculate();
59+
_monitor.push_back(e.ir, e.red);
60+
_monitor.update();
6161

62-
_irPlotter->push_back(e.ir);
63-
_spO2Plotter->push_back(_heartRate.SpO2());
62+
beat(_monitor.isBeat());
63+
_bpm = _monitor.bpm();
64+
65+
// _irPlotter->push_back(e.ir);
66+
_irPlotter->push_back(_monitor.latestIR());
67+
_spO2Plotter->push_back(_monitor.SpO2());
6468
}
6569
_intermediateBuffer.clear();
6670
unlock();
@@ -94,7 +98,7 @@ void UnitHEARTSmallUI::push(LovyanGFX* dst, const int32_t x, const int32_t y)
9498
dst->drawString(s.c_str(), left + GAP * 2, top + GAP * 2 + _irPlotter->height());
9599

96100
dst->setTextDatum(textdatum_t::bottom_right);
97-
s = m5::utility::formatString("SpO2:%3.2f%%", _heartRate.SpO2());
101+
s = m5::utility::formatString("SpO2:%3.2f%%", _monitor.SpO2());
98102
dst->drawString(s.c_str(), right - GAP, bottom - _spO2Plotter->height() - GAP);
99103

100104
constexpr int32_t radius{4};

examples/demo/MultipleUnits/src/ui/ui_UnitHEART.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class UnitHEARTSmallUI : public UnitUIBase {
2121
{
2222
}
2323

24-
inline m5::max30100::HeartRate& heartRate()
24+
inline m5::heart::PulseMonitor& monitor()
2525
{
26-
return _heartRate;
26+
return _monitor;
2727
}
2828

2929
inline void beat(bool beated)
@@ -42,7 +42,7 @@ class UnitHEARTSmallUI : public UnitUIBase {
4242
private:
4343
std::unique_ptr<m5::ui::Plotter> _irPlotter{};
4444
std::unique_ptr<m5::ui::Plotter> _spO2Plotter{};
45-
m5::max30100::HeartRate _heartRate{};
45+
m5::heart::PulseMonitor _monitor{100.0f};
4646
int32_t _beatCounter{}, _bpm{};
4747

4848
struct Data {

0 commit comments

Comments
 (0)