diff --git a/README.ja.md b/README.ja.md index 1699f9f..bf0ac23 100644 --- a/README.ja.md +++ b/README.ja.md @@ -117,18 +117,21 @@ GPIO、UART は将来対応予定です。 ### サポートされるユニット #### 動作確認済 -- [UnitCO2](https://github.com/m5stack/M5Unit-ENV) -- [UnitENVIII](https://github.com/m5stack/M5Unit-ENV) -- [UnitAmeter](https://github.com/m5stack/M5Unit-METER) -- [UnitVmeter](https://github.com/m5stack/M5Unit-METER) -- [UnitPaHub2](https://github.com/m5stack/M5Unit-HUB) -- [UnitGESTURE](https://github.com/m5stack/M5Unit-GESTURE) -- [UnitHEART](https://github.com/m5stack/M5Unit-HEART) -- [UnitKmeterISO](https://github.com/m5stack/M5Unit-KMeterISO) -- [UnitTVOC](https://github.com/m5stack/M5Unit-TVOC) - -#### 問題があり修正中 -- [UnitENVPro]((https://github.com/m5stack/M5Unit-ENV)) +- [M5Unit-ENV](https://github.com/m5stack/M5Unit-ENV) + - UnitCO2 + - UnitENVIII + - UnitTVOC + - UnitENVPro (いくつか問題があり修正中) +- [M5Unit-METER](https://github.com/m5stack/M5Unit-METER) + - UnitAmeter + - UnitVmeter + - UnitKmeterISO +- [M5Unit-HUB](https://github.com/m5stack/M5Unit-HUB) + - UnitPaHub2 +- [M5Unit-GESTURE](https://github.com/m5stack/M5Unit-GESTURE) + - UnitGESTURE +- [M5Unit-HEART](https://github.com/m5stack/M5Unit-HEART) + - UnitHEART 他のユニットは開発、確認後追加されます。 diff --git a/README.md b/README.md index 5522242..4dd7f21 100644 --- a/README.md +++ b/README.md @@ -119,21 +119,24 @@ Other devices will be added after confirmation of operation. ### Supported units #### Operation confirmed -- [UnitCO2](https://github.com/m5stack/M5Unit-ENV) -- [UnitENVIII](https://github.com/m5stack/M5Unit-ENV) -- [UnitAmeter](https://github.com/m5stack/M5Unit-METER) -- [UnitVmeter](https://github.com/m5stack/M5Unit-METER) -- [UnitPaHub2](https://github.com/m5stack/M5Unit-HUB) -- [UnitGESTURE](https://github.com/m5stack/M5Unit-GESTURE) -- [UnitHEART](https://github.com/m5stack/M5Unit-HEART) -- [UnitKmeterISO](https://github.com/m5stack/M5Unit-KMeterISO) -- [UnitTVOC](https://github.com/m5stack/M5Unit-TVOC) - -#### There are a few problems -- [UnitENVPro]((https://github.com/m5stack/M5Unit-ENV)) -Other units will be added after they are developed and tested. +- [M5Unit-ENV](https://github.com/m5stack/M5Unit-ENV) + - UnitCO2 + - UnitENVIII + - UnitTVOC + - UnitENVPro (There are a few problems) +- [M5Unit-METER](https://github.com/m5stack/M5Unit-METER) + - UnitAmeter + - UnitVmeter + - UnitKmeterISO +- [M5Unit-HUB](https://github.com/m5stack/M5Unit-HUB) + - UnitPaHub2 +- [M5Unit-GESTURE](https://github.com/m5stack/M5Unit-GESTURE) + - UnitGESTURE +- [M5Unit-HEART](https://github.com/m5stack/M5Unit-HEART) + - UnitHEART +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. diff --git a/platformio.ini b/platformio.ini index 32f52c8..c2b0d8e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -19,13 +19,14 @@ lib_deps=m5stack/M5Unified m5stack/M5Unit-HUB/ m5stack/M5Unit-GESTURE/ m5stack/M5Unit-HEART/ - m5stack/M5Unit-KMeterISO/ - m5stack/M5Unit-TVOC/ ; Using local, so ignore download by dependency lib_ignore =M5UnitUnified ; -------------------------------- +[bsec2] +lib_deps = https://github.com/boschsensortec/Bosch-BSEC2-Library.git @ 1.8.2610 + [m5base] monitor_speed = 115200 monitor_filters = esp32_exception_decoder, time @@ -44,46 +45,46 @@ board = m5stack-grey ;m5stack-core-esp32-16M ;m5stack-grey ;m5stack-core-esp32 -lib_deps = ${env.lib_deps} - https://github.com/boschsensortec/Bosch-BSEC2-Library.git +lib_deps = ${env.lib_deps} + ${bsec2.lib_deps} [Core2] extends = m5base board = m5stack-core2 -lib_deps = ${env.lib_deps} - https://github.com/boschsensortec/Bosch-BSEC2-Library.git +lib_deps = ${env.lib_deps} + ${bsec2.lib_deps} [CoreS3] extends = m5base board = m5stack-cores3 -lib_deps = ${env.lib_deps} - https://github.com/boschsensortec/Bosch-BSEC2-Library.git +lib_deps = ${env.lib_deps} + ${bsec2.lib_deps} [Fire] extends = m5base board =m5stack-fire -lib_deps = ${env.lib_deps} - https://github.com/boschsensortec/Bosch-BSEC2-Library.git +lib_deps = ${env.lib_deps} + ${bsec2.lib_deps} [StampS3] ;include M5Capsule extends = m5base board = m5stack-stamps3 -lib_deps = ${env.lib_deps} - https://github.com/boschsensortec/Bosch-BSEC2-Library.git +lib_deps = ${env.lib_deps} + ${bsec2.lib_deps} [Dial] extends = m5base board = m5stack-stamps3 lib_deps = ${env.lib_deps} + ${bsec2.lib_deps} m5stack/M5Dial - https://github.com/boschsensortec/Bosch-BSEC2-Library.git [AtomS3] extends = m5base board = m5stack-atoms3 -lib_deps = ${env.lib_deps} - https://github.com/boschsensortec/Bosch-BSEC2-Library.git +lib_deps = ${env.lib_deps} + ${bsec2.lib_deps} ; Using ./boards/m5stack-nanoc6.json [NanoC6] @@ -99,15 +100,15 @@ lib_deps = ${env.lib_deps} [StickCPlus] extends = m5base board = m5stick-c -lib_deps = ${env.lib_deps} - https://github.com/boschsensortec/Bosch-BSEC2-Library.git +lib_deps = ${env.lib_deps} + ${bsec2.lib_deps} [Paper] extends = m5base board = m5stack-fire ; Using M5Fire instead of the M5Paper(Noting...) -lib_deps = ${env.lib_deps} - https://github.com/boschsensortec/Bosch-BSEC2-Library.git +lib_deps = ${env.lib_deps} + ${bsec2.lib_deps} [sdl] build_flags = -O3 -xc++ -std=c++14 -lSDL2 @@ -172,229 +173,186 @@ custom_exclude_src_files=bme68xLibrary.cpp bsec2.cpp BMP280.cpp DHT12.cpp M5Unit [env:test_Core] extends=Core, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} lib_deps = ${Core.lib_deps} ${test_fw.lib_deps} [env:test_Core2] extends=Core2, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} lib_deps = ${Core2.lib_deps} ${test_fw.lib_deps} [env:test_CoreS3] extends=CoreS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} lib_deps = ${CoreS3.lib_deps} ${test_fw.lib_deps} [env:test_Fire] extends=Fire, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} lib_deps = ${Fire.lib_deps} ${test_fw.lib_deps} [env:test_StampS3] extends=StampS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} lib_deps = ${StampS3.lib_deps} ${test_fw.lib_deps} [env:test_Dial] extends=Dial3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} lib_deps = ${Dial.lib_deps} ${test_fw.lib_deps} [env:test_AtomS3] extends=AtomS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} lib_deps = ${AtomS3.lib_deps} ${test_fw.lib_deps} [env:test_NanoC6] extends=NanoC6, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} lib_deps = ${NanoC6.lib_deps} ${test_fw.lib_deps} [env:test_StickCPlus] extends=StickCPlus, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} lib_deps = ${StickCPlus.lib_deps} ${test_fw.lib_deps} [env:test_Paper] extends=Paper, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} lib_deps = ${Paper.lib_deps} ${test_fw.lib_deps} ;examples Simple [env:Simple_Core] extends=Core, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/Simple> [env:Simple_Core2] extends=Core2, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/Simple> [env:Simple_CoreS3] extends=CoreS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/Simple> [env:Simple_Fire] extends=Fire, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/Simple> [env:Simple_StampS3] extends=StampS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/Simple> [env:Simple_Dial] extends=Dial, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/Simple> [env:Simple_AtomS3] extends=AtomS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/Simple> [env:Simple_NanoC6] extends=NanoC6, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/Simple> [env:Simple_StickCPlus] extends=StickCPlus, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/Simple> [env:Simple_Paper] extends=Paper, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/Simple> ;examples SelfUpdate [env:SelfUpdate_Core] extends=Core, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/SelfUpdate> [env:SelfUpdate_Core2] extends=Core2, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/SelfUpdate> [env:SelfUpdate_CoreS3] extends=CoreS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/SelfUpdate> [env:SelfUpdate_Fire] extends=Fire, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/SelfUpdate> [env:SelfUpdate_StampS3] extends=StampS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/SelfUpdate> [env:SelfUpdate_Dial] extends=Dial, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/SelfUpdate> [env:SelfUpdate_AtomS3] extends=AtomS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/SelfUpdate> [env:SelfUpdate_NanoC6] extends=NanoC6, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/SelfUpdate> [env:SelfUpdate_StickCPlus] extends=StickCPlus, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/SelfUpdate> [env:SelfUpdate_Paper] extends=Paper, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/SelfUpdate> ;examples ComponentOnly [env:ComponentOnly_Core] extends=Core, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/ComponentOnly> [env:ComponentOnly_Core2] extends=Core2, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/ComponentOnly> [env:ComponentOnly_CoreS3] extends=CoreS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/ComponentOnly> [env:ComponentOnly_Fire] extends=Fire, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/ComponentOnly> [env:ComponentOnly_StampS3] extends=StampS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/ComponentOnly> [env:ComponentOnly_Dial] extends=Dial, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/ComponentOnly> [env:ComponentOnly_AtomS3] extends=AtomS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/ComponentOnly> [env:ComponentOnly_NanoC6] extends=NanoC6, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/ComponentOnly> [env:ComponentOnly_StickCPlus] extends=StickCPlus, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/ComponentOnly> [env:ComponentOnly_Paper] extends=Paper, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/Basic/ComponentOnly> ;demo MultipleUnits [env:MultipleUnits_Core] extends=Core, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/demo/MultipleUnits> [env:MultipleUnits_Core2] extends=Core2, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/demo/MultipleUnits> [env:MultipleUnits_CoreS3] extends=CoreS3, option_release -build_flags = ${env.build_flags} ${option_release.build_flags} build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/demo/MultipleUnits> diff --git a/src/M5UnitComponent.cpp b/src/M5UnitComponent.cpp index 832e293..2f6ab33 100644 --- a/src/M5UnitComponent.cpp +++ b/src/M5UnitComponent.cpp @@ -126,7 +126,9 @@ bool Component::assign(TwoWire& wire) bool Component::selectChannel(const uint8_t ch) { - M5_LIB_LOGV("%s:%u", deviceName(), ch); + if (ch != 255) { + M5_LIB_LOGV("%s:%u", deviceName(), ch); + } bool ret{true}; if (hasParent()) { ret = _parent->selectChannel(channel()); diff --git a/src/M5UnitComponent.hpp b/src/M5UnitComponent.hpp index a35da04..6eb1999 100644 --- a/src/M5UnitComponent.hpp +++ b/src/M5UnitComponent.hpp @@ -166,7 +166,7 @@ class Component { /*! @brief In periodic measurement? */ inline bool inPeriodic() const { - return _periodic; + return in_periodic(); } //! @brief Periodic measurement data updated? inline bool updated() const @@ -345,6 +345,10 @@ class Component { virtual const char* unit_device_name() const = 0; virtual types::uid_t unit_identifier() const = 0; virtual types::attr_t unit_attribute() const = 0; + inline virtual bool in_periodic() const + { + return _periodic; + } // Duplicate the adapter for children // Note that ownership of the return pointer is delegated to the destination