Skip to content

Commit

Permalink
Merge branch 'alpha2' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
GOB52 committed Oct 25, 2024
2 parents 4b00ac7 + c588594 commit d93ade2
Show file tree
Hide file tree
Showing 14 changed files with 300 additions and 72 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ on:
- '**.c'
- '**.inl'
- '**clang-format-check.yml'
pull_request:
- '**.clang-format'
pull_request:
paths:
- '**.ino'
- '**.cpp'
- '**.hpp'
- '**.h'
- '**.c'
- '**.inl'
- '**clang-format-check.yml'
- '**.clang-format'
workflow_dispatch:

jobs:
formatting-check:
Expand All @@ -29,12 +33,12 @@ jobs:
strategy:
matrix:
path:
#- check: './' # path to include
# exclude: '' # path to exclude
- check: 'src'
exclude: ''
- check: 'test'
- check: 'examples'
# exclude: '(Fonts)' # Exclude file paths containing "Fonts"
exclude: ''
- check: 'examples/Basic'
exclude: ''

steps:
- name: Checkout
Expand All @@ -49,3 +53,4 @@ jobs:
check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }}
include-regex: ${{ env.INCLUDE_REGEX }}

51 changes: 38 additions & 13 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,37 @@ ESP-IDF は将来対応予定です。
GPIO、UART は将来対応予定です。


### サポートされる Core デバイス (動作確認済)
- M5Stack Core (BASIC / GRAY / FIRE)
- M5Stack Core2
- M5Stick CPlus
- M5Paper
- M5Stack CoreS3 CoreS3SE
- M5ATOMS3
- M5STAMPS3
- M5Dial
- M5Capsule
- M5NanoC6
### サポートされるデバイス (動作確認済)
こちらを参照 https://docs.m5stack.com/en/products

- CORE
- [BASIC](https://docs.m5stack.com/en/core/basic)
- [2.6](https://docs.m5stack.com/en/core/BASIC%20v2.6)
- [GRAY](https://docs.m5stack.com/en/core/gray)
- [Core2](https://docs.m5stack.com/en/core/core2)
- [For AWS](https://docs.m5stack.com/en/core/core2_for_aws)
- [v.1.1](https://docs.m5stack.com/en/core/Core2%20v1.1)
- [CoreS3](https://docs.m5stack.com/en/core/CoreS3)
- [CoreS3 SE](https://docs.m5stack.com/en/core/M5CoreS3%20SE)
- [FIRE](https://docs.m5stack.com/en/core/fire)
- [v2.6](https://docs.m5stack.com/en/core/fire_v2.6)
- [M5Dial](https://docs.m5stack.com/en/core/M5Dial)
- [M5Capsule](https://docs.m5stack.com/en/core/M5Capsule)
- [M5DinMeter](https://docs.m5stack.com/en/core/M5DinMeter)
- [M5NanoC6](https://docs.m5stack.com/en/core/M5NanoC6)
- STICK
- [M5Stick CPlus](https://docs.m5stack.com/en/core/m5stickc_plus)
- [M5Stick CPlus2](https://docs.m5stack.com/en/core/M5StickC%20PLUS2)
- ATOM
- [ATOM Matrix](https://docs.m5stack.com/en/core/ATOM%20Matrix)
- [AtomS3](https://docs.m5stack.com/en/core/AtomS3)
- [AtomS3R](https://docs.m5stack.com/en/core/AtomS3R)
- [AtomS3R Cam](https://docs.m5stack.com/en/core/AtomS3R%20Cam)
- STAMP
- [StampS3](https://docs.m5stack.com/en/core/StampS3)
- E-PAPER
- [CORE.INK](https://docs.m5stack.com/en/core/coreink)
- [M5PAPER](https://docs.m5stack.com/en/core/m5paper)

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

Expand All @@ -121,7 +141,7 @@ GPIO、UART は将来対応予定です。
- UnitCO2
- UnitENVIII
- UnitTVOC
- UnitENVPro (いくつか問題があり修正中)
- UnitENVPro
- [M5Unit-METER](https://github.com/m5stack/M5Unit-METER)
- UnitAmeter
- UnitVmeter
Expand All @@ -132,13 +152,18 @@ GPIO、UART は将来対応予定です。
- UnitGESTURE
- [M5Unit-HEART](https://github.com/m5stack/M5Unit-HEART)
- UnitHEART
- [M5Unit-TOF](https://github.com/m5stack/M5Unit-TOF)
- UnitToF
- UnitToF4M
- [M5Unit-WEIGHT](https://github.com/m5stack/M5Unit-WEIGHT)
- UnitWeightI2C

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


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


## Doxygen ドキュメント
Expand Down
52 changes: 38 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,37 @@ Support ESP-IDF with M5HAL in the future.

Support GPIO, UART in the future.

### Supported core device (Operation confirmed)

- M5Stack Core (BASIC / GRAY / FIRE)
- M5Stack Core2
- M5Stick CPlus
- M5Paper
- M5Stack CoreS3 CoreS3SE
- M5ATOMS3
- M5STAMPS3
- M5Dial
- M5Capsule
- M5NanoC6
### Supported devices (Operation confirmed)
See also https://docs.m5stack.com/en/products

- CORE
- [BASIC](https://docs.m5stack.com/en/core/basic)
- [2.6](https://docs.m5stack.com/en/core/BASIC%20v2.6)
- [GRAY](https://docs.m5stack.com/en/core/gray)
- [Core2](https://docs.m5stack.com/en/core/core2)
- [For AWS](https://docs.m5stack.com/en/core/core2_for_aws)
- [v.1.1](https://docs.m5stack.com/en/core/Core2%20v1.1)
- [CoreS3](https://docs.m5stack.com/en/core/CoreS3)
- [CoreS3 SE](https://docs.m5stack.com/en/core/M5CoreS3%20SE)
- [FIRE](https://docs.m5stack.com/en/core/fire)
- [v2.6](https://docs.m5stack.com/en/core/fire_v2.6)
- [M5Dial](https://docs.m5stack.com/en/core/M5Dial)
- [M5Capsule](https://docs.m5stack.com/en/core/M5Capsule)
- [M5DinMeter](https://docs.m5stack.com/en/core/M5DinMeter)
- [M5NanoC6](https://docs.m5stack.com/en/core/M5NanoC6)
- STICK
- [M5Stick CPlus](https://docs.m5stack.com/en/core/m5stickc_plus)
- [M5Stick CPlus2](https://docs.m5stack.com/en/core/M5StickC%20PLUS2)
- ATOM
- [ATOM Matrix](https://docs.m5stack.com/en/core/ATOM%20Matrix)
- [AtomS3](https://docs.m5stack.com/en/core/AtomS3)
- [AtomS3R](https://docs.m5stack.com/en/core/AtomS3R)
- [AtomS3R Cam](https://docs.m5stack.com/en/core/AtomS3R%20Cam)
- STAMP
- [StampS3](https://docs.m5stack.com/en/core/StampS3)
- E-PAPER
- [CORE.INK](https://docs.m5stack.com/en/core/coreink)
- [M5PAPER](https://docs.m5stack.com/en/core/m5paper)

Other devices will be added after confirmation of operation.

Expand All @@ -124,7 +143,7 @@ Other devices will be added after confirmation of operation.
- UnitCO2
- UnitENVIII
- UnitTVOC
- UnitENVPro (There are a few problems)
- UnitENVPro
- [M5Unit-METER](https://github.com/m5stack/M5Unit-METER)
- UnitAmeter
- UnitVmeter
Expand All @@ -135,12 +154,17 @@ Other devices will be added after confirmation of operation.
- UnitGESTURE
- [M5Unit-HEART](https://github.com/m5stack/M5Unit-HEART)
- UnitHEART
- [M5Unit-TOF](https://github.com/m5stack/M5Unit-TOF)
- UnitToF
- UnitToF4M
- [M5Unit-WEIGHT](https://github.com/m5stack/M5Unit-WEIGHT)
- UnitWeightI2C

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

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


## Doxygen document
Expand Down
41 changes: 41 additions & 0 deletions boards/m5stack-atoms3r.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"build": {
"arduino": {
"memory_type": "qio_opi",
"ldscript": "esp32s3_out.ld",
"partitions": "default_8MB.csv"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_M5STACK_ATOMS3R",
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"mcu": "esp32s3",
"variant": "m5stack_atoms3"
},
"connectivity": [
"bluetooth",
"wifi"
],
"frameworks": [
"arduino",
"espidf"
],
"name": "M5Stack AtomS3R",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.m5stack.com/en/core/AtomS3R",
"vendor": "M5Stack"
}
2 changes: 1 addition & 1 deletion boards/m5stack-nanoc6.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"build": {
"core": "esp32",
"extra_flags": [
"-DARDUINO_M5Stack_NanoC6"
"-DARDUINO_M5STACK_NANOC6"
],
"f_cpu": "160000000L",
"f_flash": "80000000L",
Expand Down
40 changes: 40 additions & 0 deletions boards/m5stick-cplus2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"build": {
"arduino":{
"ldscript": "esp32_out.ld",
"partitions": "default_8MB.csv"
},
"core": "esp32",
"extra_flags": [
"-DM5STACK_M5STICK_CPLUS2",
"-DBOARD_HAS_PSRAM",
"-mfix-esp32-psram-cache-issue",
"-mfix-esp32-psram-cache-strategy=memw",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "m5stick_c"
},
"connectivity": [
"wifi",
"bluetooth"
],
"frameworks": [
"arduino",
"espidf"
],
"name": "M5Stick-CPlus2",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"require_upload_port": true,
"speed": 1500000
},
"url": "https://docs.m5stack.com/en/core/M5StickC%20PLUS2",
"vendor": "M5Stack"
}
2 changes: 1 addition & 1 deletion examples/demo/MultipleUnits/main/MultipleUnits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void prepare()
tvocSmallUI.construct();
vmeterSmallUI.construct();
env3SmallUI.construct();
heartSmallUI.heartRate().setSampleRate(m5::max30100::HeartRate::getSampleRate(unitHeart.config().sample_rate));
heartSmallUI.monitor().setSamplingRate(m5::unit::max30100::getSamplingRate(unitHeart.config().sampling_rate));
}

// task for Vmeter
Expand Down
14 changes: 9 additions & 5 deletions examples/demo/MultipleUnits/src/ui/ui_UnitHEART.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ void UnitHEARTSmallUI::update()

lock();
for (auto&& e : _intermediateBuffer) {
beat(_heartRate.push_back(e.ir, e.red));
_bpm = _heartRate.calculate();
_monitor.push_back(e.ir, e.red);
_monitor.update();

_irPlotter->push_back(e.ir);
_spO2Plotter->push_back(_heartRate.SpO2());
beat(_monitor.isBeat());
_bpm = _monitor.bpm();

// _irPlotter->push_back(e.ir);
_irPlotter->push_back(_monitor.latestIR());
_spO2Plotter->push_back(_monitor.SpO2());
}
_intermediateBuffer.clear();
unlock();
Expand Down Expand Up @@ -94,7 +98,7 @@ void UnitHEARTSmallUI::push(LovyanGFX* dst, const int32_t x, const int32_t y)
dst->drawString(s.c_str(), left + GAP * 2, top + GAP * 2 + _irPlotter->height());

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

constexpr int32_t radius{4};
Expand Down
6 changes: 3 additions & 3 deletions examples/demo/MultipleUnits/src/ui/ui_UnitHEART.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class UnitHEARTSmallUI : public UnitUIBase {
{
}

inline m5::max30100::HeartRate& heartRate()
inline m5::heart::PulseMonitor& monitor()
{
return _heartRate;
return _monitor;
}

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

struct Data {
Expand Down
Loading

0 comments on commit d93ade2

Please sign in to comment.