diff --git a/.github/workflows/ArduinoBuild_2.yml b/.github/workflows/arduino-esp-v2-build-check.yml similarity index 87% rename from .github/workflows/ArduinoBuild_2.yml rename to .github/workflows/arduino-esp-v2-build-check.yml index e9dd20a..07f389d 100644 --- a/.github/workflows/ArduinoBuild_2.yml +++ b/.github/workflows/arduino-esp-v2-build-check.yml @@ -1,4 +1,4 @@ -name: ArduinoBuild(platform-version 2.x) +name: Build(arduino-esp32:2.x) env: SKETCH_NAMES_FIND_START: ./examples/UnitUnified @@ -8,6 +8,7 @@ on: push: tags-ignore: - '*.*.*' + - 'v*.*.*' branches: - '*' paths: @@ -24,7 +25,7 @@ on: - 'examples/UnitUnified/**.hpp' - 'examples/UnitUnified/**.h' - 'examples/UnitUnified/**.c' - - '**ArduinoBuild_2.yml' + - '**arduino-esp-v2-build-check.yml' pull_request: paths: - 'src/unit/**.cpp' @@ -40,12 +41,12 @@ on: - 'examples/UnitUnified/**.hpp' - 'examples/UnitUnified/**.h' - 'examples/UnitUnified/**.c' - - '**ArduinoBuild_2.yml' + - '**arduino-esp-v2-build-check.yml' workflow_dispatch: jobs: build: - name: ${{ matrix.unit }}:${{ matrix.sketch }}:${{ matrix.board }}@${{ matrix.platform-version }} + name: ${{ matrix.unit }}:${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}} runs-on: ubuntu-latest strategy: @@ -54,7 +55,6 @@ jobs: matrix: platform-url: - https://espressif.github.io/arduino-esp32/package_esp32_index.json -# - https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json sketch: - PlotToSerial @@ -64,14 +64,15 @@ jobs: - UnitToF4M board: + - m5stack-atom + - m5stack-atoms3 - m5stack-core-esp32 - m5stack-core2 - - m5stack-atoms3 + - m5stack-coreink - m5stack-cores3 + - m5stack-fire platform-version: - #- 2.0.15 - #- 2.0.16 - 2.0.17 platform: diff --git a/.github/workflows/ArduinoBuild_3.yml b/.github/workflows/arduino-esp-v3-build-check.yml similarity index 81% rename from .github/workflows/ArduinoBuild_3.yml rename to .github/workflows/arduino-esp-v3-build-check.yml index 41bc1b6..5e3f352 100644 --- a/.github/workflows/ArduinoBuild_3.yml +++ b/.github/workflows/arduino-esp-v3-build-check.yml @@ -1,13 +1,13 @@ -name: ArduinoBuild(platform-version 3.x) +name: Build(arduino-esp32:3.x) env: SKETCH_NAMES_FIND_START: ./examples/UnitUnified REQUIRED_LIBRARIES: M5Unified,M5UnitUnified - on: push: tags-ignore: - '*.*.*' + - 'v*.*.*' branches: - '*' paths: @@ -24,7 +24,7 @@ on: - 'examples/UnitUnified/**.hpp' - 'examples/UnitUnified/**.h' - 'examples/UnitUnified/**.c' - - '**ArduinoBuild_3.yml' + - '**arduino-esp-v3-build-check.yml' pull_request: paths: - 'src/unit/**.cpp' @@ -40,7 +40,7 @@ on: - 'examples/UnitUnified/**.hpp' - 'examples/UnitUnified/**.h' - 'examples/UnitUnified/**.c' - - '**ArduinoBuild_3.yml' + - '**arduino-esp-v3-build-check.yml' workflow_dispatch: jobs: @@ -54,30 +54,41 @@ jobs: matrix: platform-url: - https://espressif.github.io/arduino-esp32/package_esp32_index.json -# - https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json + + sketch: + - PlotToSerial unit: - UnitToF - UnitToF4M - sketch: - - PlotToSerial - board: + - m5stack_atom + - m5stack_atoms3 + - m5stack_capsule +# - m5stack_cardputer - m5stack_core - m5stack_core2 - - m5stack_atoms3 + - m5stack_coreink - m5stack_cores3 - m5stack_dial + - m5stack_fire - m5stack_nanoc6 - m5stack_paper +# - m5stack_poe_cam +# - m5stack_stamp_c3 +# - m5stack_stamp_pico + - m5stack_stamp_s3 +# - m5stack_station +# - m5stack_stickc - m5stack_stickc_plus + - m5stack_stickc_plus2 +# - m5stack_timer_cam +# - m5stack_tough +# - m5stack_unit_cam +# - m5stack_unit_cams3 platform-version: - #- 3.0.0 - #- 3.0.1 - #- 3.0.2 - #- 3.0.3 - 3.0.4 platform: diff --git a/.github/workflows/arduino-m5-build-check.yml b/.github/workflows/arduino-m5-build-check.yml new file mode 100644 index 0000000..5c87bd2 --- /dev/null +++ b/.github/workflows/arduino-m5-build-check.yml @@ -0,0 +1,121 @@ +name: Build(arduino-m5stack) + +env: + SKETCH_NAMES_FIND_START: ./examples/UnitUnified + REQUIRED_LIBRARIES: M5Unified,M5UnitUnified + +on: + push: + tags-ignore: + - '*.*.*' + - 'v*.*.*' + branches: + - '*' + paths: + - 'src/unit/**.cpp' + - 'src/unit/**.hpp' + - 'src/unit/**.h' + - 'src/unit/**.c' + - 'test/**.cpp' + - 'test/**.hpp' + - 'test/**.h' + - 'test/**.c' + - 'examples/UnitUnified/**.ino' + - 'examples/UnitUnified/**.cpp' + - 'examples/UnitUnified/**.hpp' + - 'examples/UnitUnified/**.h' + - 'examples/UnitUnified/**.c' + - '**arduino-m5-build-check.yml' + pull_request: + paths: + - 'src/unit/**.cpp' + - 'src/unit/**.hpp' + - 'src/unit/**.h' + - 'src/unit/**.c' + - 'test/**.cpp' + - 'test/**.hpp' + - 'test/**.h' + - 'test/**.c' + - 'examples/UnitUnified/**.ino' + - 'examples/UnitUnified/**.cpp' + - 'examples/UnitUnified/**.hpp' + - 'examples/UnitUnified/**.h' + - 'examples/UnitUnified/**.c' + - '**arduino-m5-build-check.yml' + workflow_dispatch: + +jobs: + build: + name: ${{ matrix.unit }}:${{ matrix.sketch }}:${{matrix.board}}@${{matrix.platform-version}} + runs-on: ubuntu-latest + + strategy: + fail-fast: false +# max-parallel: 1 + matrix: + platform-url: + - https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json + + sketch: + - PlotToSerial + + unit: + - UnitToF + - UnitToF4M + + board: + - m5stack_atom + - m5stack_atoms3 + - m5stack_atoms3r + - m5stack_capsule +# - m5stack_cardputer + - m5stack_core + - m5stack_core2 + - m5stack_coreink + - m5stack_cores3 + - m5stack_dial + - m5stack_dinmeter + - m5stack_fire + - m5stack_paper +# - m5stack_poe_cam +# - m5stack_stamp_c3 +# - m5stack_stamp_pico + - m5stack_stamp_s3 +# - m5stack_station +# - m5stack_stickc + - m5stack_stickc_plus + - m5stack_stickc_plus2 +# - m5stack_timer_cam +# - m5stack_tough +# - m5stack_unit_cam +# - m5stack_unit_cams3 + + platform-version: + - 2.1.2 + + platform: + - m5stack + + archi: + - esp32 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + # Build + - name: Compile examples + uses: ArminJo/arduino-test-compile@master + with: + arduino-board-fqbn: ${{ matrix.platform }}:${{ matrix.archi }}:${{ matrix.board }} + arduino-platform: ${{ matrix.platform }}:${{ matrix.archi }}@${{ matrix.platform-version }} + platform-url: ${{ matrix.platform-url }} + required-libraries: ${{ env.REQUIRED_LIBRARIES }} + extra-arduino-cli-args: ${{ matrix.cli-args }} + #build-properties: ${{ toJson(matrix.build-properties) }} + sketch-names: ${{ matrix.sketch }}.ino + sketch-names-find-start: ${{ env.SKETCH_NAMES_FIND_START }}/${{ matrix.unit }} + #sketches-exclude: ${{ matrix.sketches-exclude }} + diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index f7d9f6c..74dd0e4 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -11,7 +11,6 @@ on: branches: - '*' paths: - - '*' - '**.ino' - '**.cpp' - '**.hpp' diff --git a/.github/workflows/PlatformioBuild.yml b/.github/workflows/platformio-build-check.yml similarity index 55% rename from .github/workflows/PlatformioBuild.yml rename to .github/workflows/platformio-build-check.yml index 2974c3c..011ee73 100644 --- a/.github/workflows/PlatformioBuild.yml +++ b/.github/workflows/platformio-build-check.yml @@ -1,9 +1,10 @@ -name: PlatformIOBuild +name: Build(platformio) on: push: tags-ignore: - '*.*.*' + - 'v*.*.*' branches: - '*' paths: @@ -20,7 +21,7 @@ on: - 'examples/UnitUnified/**.hpp' - 'examples/UnitUnified/**.h' - 'examples/UnitUnified/**.c' - - '**PlatformioBuild.yml' + - '/platformio-build-check.yml' - '**platformio.ini' pull_request: paths: @@ -37,7 +38,7 @@ on: - 'examples/UnitUnified/**.hpp' - 'examples/UnitUnified/**.h' - 'examples/UnitUnified/**.c' - - '**PlatformioBuild.yml' + - '**/platformio-build-check.yml' - '**platformio.ini' workflow_dispatch: @@ -62,51 +63,55 @@ jobs: - Core - Core2 - CoreS3 + - Fire - StampS3 - - AtomS3 - Dial + - AtomMatrix + - AtomS3 + - AtomS3R - NanoC6 - StickCPlus + - StickCPlus2 - Paper - - Fire + - CoreInk framework: - Arduino espressif32: - latest - - '5_4_0' - - '4_4_0' +# - '5_4_0' +# - '4_4_0' - exclude: - - board: CoreS3 - espressif32: '5_4_0' - - board: CoreS3 - espressif32: '4_4_0' - - board: StampS3 - espressif32: '5_4_0' - - board: StampS3 - espressif32: '4_4_0' - - board: AtomS3 - espressif32: '5_4_0' - - board: AtomS3 - espressif32: '4_4_0' - - board: Dial - espressif32: '5_4_0' - - board: Dial - espressif32: '4_4_0' - - board: NanoC6 - espressif32: '5_4_0' - - board: NanoC6 - espressif32: '4_4_0' - - board: StickCPlus - espressif32: '5_4_0' - - board: StickCPlus - espressif32: '4_4_0' - - board: Paper - espressif32: '5_4_0' - - board: Paper - espressif32: '4_4_0' +# exclude: +# - board: CoreS3 +# espressif32: '5_4_0' +# - board: CoreS3 +# espressif32: '4_4_0' +# - board: StampS3 +# espressif32: '5_4_0' +# - board: StampS3 +# espressif32: '4_4_0' +# - board: AtomS3 +# espressif32: '5_4_0' +# - board: AtomS3 +# espressif32: '4_4_0' +# - board: Dial +# espressif32: '5_4_0' +# - board: Dial +# espressif32: '4_4_0' +# - board: NanoC6 +# espressif32: '5_4_0' +# - board: NanoC6 +# espressif32: '4_4_0' +# - board: StickCPlus +# espressif32: '5_4_0' +# - board: StickCPlus +# espressif32: '4_4_0' +# - board: Paper +# espressif32: '5_4_0' +# - board: Paper +# espressif32: '4_4_0' steps: - name: Checkout @@ -117,11 +122,11 @@ jobs: - name: Build examples uses: karniv00l/platformio-run-action@v1 with: - environments: ${{ matrix.unit }}_${{ matrix.example }}_${{ matrix.board }}_${{ matrix.framework }}_${{ matrix.espressif32 }} - #targets: + environments: ${{ matrix.unit != '' && format('{0}_{1}_{2}_{3}_{4}', matrix.unit, matrix.example, matrix.board, matrix.framework, matrix.espressif32) || format('{0}_{1}_{2}_{3}', matrix.example, matrix.board, matrix.framework, matrix.espressif32) }} +# targets: project-dir: "./" project-conf: "./platformio.ini" - #jobs: 6 - #silent: false - #verbose: true - #disable-auto-clean: false +# jobs: 6 +# silent: false +# verbose: true +# disable-auto-clean: false diff --git a/README.md b/README.md index 8d6847c..01512a3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# M5Unit - ToF +# M5Unit - TOF ## Overview @@ -36,14 +36,14 @@ See also examples using conventional methods here. ## License -- [M5Unit-ToF- MIT](LICENSE) +- [M5Unit-TOF- MIT](LICENSE) ## Examples See also [examples/UnitUnified](examples/UnitUnified) ## Doxygen document -[GitHub Pages](https://m5stack.github.io/M5Unit-ToF/) +[GitHub Pages](https://m5stack.github.io/M5Unit-TOF/) If you want to generate documents on your local machine, execute the following command diff --git a/boards/m5stack-atoms3r.json b/boards/m5stack-atoms3r.json new file mode 100644 index 0000000..1c9ecce --- /dev/null +++ b/boards/m5stack-atoms3r.json @@ -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" +} diff --git a/boards/m5stack-nanoc6.json b/boards/m5stack-nanoc6.json index cae742e..ddaad65 100644 --- a/boards/m5stack-nanoc6.json +++ b/boards/m5stack-nanoc6.json @@ -2,7 +2,7 @@ "build": { "core": "esp32", "extra_flags": [ - "-DARDUINO_M5Stack_NanoC6" + "-DARDUINO_M5STACK_NANOC6" ], "f_cpu": "160000000L", "f_flash": "80000000L", diff --git a/boards/m5stick-cplus2.json b/boards/m5stick-cplus2.json new file mode 100644 index 0000000..91fa2ca --- /dev/null +++ b/boards/m5stick-cplus2.json @@ -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" +} diff --git a/examples/UnitUnified/UnitToF/PlotToSerial/main/PlotToSerial.cpp b/examples/UnitUnified/UnitToF/PlotToSerial/main/PlotToSerial.cpp index 6aacfd7..e6fcad7 100644 --- a/examples/UnitUnified/UnitToF/PlotToSerial/main/PlotToSerial.cpp +++ b/examples/UnitUnified/UnitToF/PlotToSerial/main/PlotToSerial.cpp @@ -8,7 +8,7 @@ */ #include #include -#include +#include #include namespace { diff --git a/examples/UnitUnified/UnitToF4M/PlotToSerial/main/PlotToSerial.cpp b/examples/UnitUnified/UnitToF4M/PlotToSerial/main/PlotToSerial.cpp index 3b92c49..161b952 100644 --- a/examples/UnitUnified/UnitToF4M/PlotToSerial/main/PlotToSerial.cpp +++ b/examples/UnitUnified/UnitToF4M/PlotToSerial/main/PlotToSerial.cpp @@ -8,7 +8,7 @@ */ #include #include -#include +#include #include namespace { diff --git a/platformio.ini b/platformio.ini index 1abe53b..e4404f1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -3,8 +3,6 @@ ; For UnitTest and examples (Using M5UnitUnified) ;----------------------------------------------------------------------- [platformio] -;default_envs = test_UnitToF4M_Core, test_UnitToF4M_Core2, test_UnitToF4M_CoreS3, test_UnitToF4M_Fire, test_UnitToF4M_StampS3, test_UnitToF4M_Dial, test_UnitToF4M_AtomS3, test_UnitToF4M_NanoC6, test_UnitToF4M_StickCPlus, test_UnitToF4M_Paper -;default_envs = PlotToSerial_Core_Arduino_latest, PlotToSerial_Core_Arduino_5_4_0, PlotToSerial_Core_Arduino_4_4_0, PlotToSerial_Core2_Arduino_latest, PlotToSerial_Core2_Arduino_5_4_0, PlotToSerial_Core2_Arduino_4_4_0, PlotToSerial_CoreS3_Arduino_latest, PlotToSerial_Fire_Arduino_latest, PlotToSerial_Fire_Arduino_5_4_0, PlotToSerial_Fire_Arduino_4_4_0, PlotToSerial_StampS3_Arduino_latest, PlotToSerial_AtomS3_Arduino_latest, PlotToSerial_Dial_Arduino_latest, PlotToSerial_NanoC6_Arduino_latest, PlotToSerial_StickCPlus_Arduino_latest, PlotToSerial_Paper_Arduino_latest [env] build_flags =-Wall -Wextra -Wreturn-local-addr -Werror=format -Werror=return-local-addr @@ -45,7 +43,7 @@ board = m5stack-fire lib_deps = ${env.lib_deps} [StampS3] -;include M5Capsule +;include M5Capsule, DinMeter extends = m5base board = m5stack-stamps3 lib_deps = ${env.lib_deps} @@ -56,11 +54,22 @@ board = m5stack-stamps3 lib_deps = ${env.lib_deps} m5stack/M5Dial +[AtomMatrix] +extends = m5base +board = m5stack-atom +lib_deps = ${env.lib_deps} + [AtomS3] extends = m5base board = m5stack-atoms3 lib_deps = ${env.lib_deps} +; Using ./boards/m5stack-atoms3r.json +[AtomS3R] +extends = m5base +board = m5stack-atoms3r +lib_deps = ${env.lib_deps} + ; Using ./boards/m5stack-nanoc6.json [NanoC6] extends = m5base @@ -77,10 +86,20 @@ extends = m5base board = m5stick-c lib_deps = ${env.lib_deps} +; Using ./boards/m5stick-cplus2.json +[StickCPlus2] +extends = m5base +board = m5stick-cplus2 +lib_deps = ${env.lib_deps} + [Paper] extends = m5base board = m5stack-fire -; Using M5Fire instead of the M5Paper(Noting...) +lib_deps = ${env.lib_deps} + +[CoreInk] +extends = m5base +board = m5stack-coreink lib_deps = ${env.lib_deps} [sdl] @@ -199,12 +218,24 @@ lib_deps = ${Dial.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vl53l1x +[env:test_UnitToF4M_AtomMatrix] +extends=AtomMatrix, option_release, arduino_latest +lib_deps = ${AtomMatrix.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vl53l1x + [env:test_UnitToF4M_AtomS3] extends=AtomS3, option_release, arduino_latest lib_deps = ${AtomS3.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vl53l1x +[env:test_UnitToF4M_AtomS3R] +extends=AtomS3R, option_release, arduino_latest +lib_deps = ${AtomS3R.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vl53l1x + [env:test_UnitToF4M_NanoC6] extends=NanoC6, option_release, arduino_latest lib_deps = ${NanoC6.lib_deps} @@ -217,12 +248,24 @@ lib_deps = ${StickCPlus.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vl53l1x +[env:test_UnitToF4M_StickCPlus2] +extends=StickCPlus2, option_release, arduino_latest +lib_deps = ${StickCPlus2.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vl53l1x + [env:test_UnitToF4M_Paper] extends=Paper, option_release, arduino_latest lib_deps = ${Paper.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vl53l1x +[env:test_UnitToF4M_CoreInk] +extends=CoreInk, option_release, arduino_latest +lib_deps = ${CoreInk.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vl53l1x + ;ToF [env:test_UnitToF_Core] extends=Core, option_release, arduino_latest @@ -260,12 +303,24 @@ lib_deps = ${Dial.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vl53l0x +[env:test_UnitToF_AtomMatrix] +extends=AtomMatrix, option_release, arduino_latest +lib_deps = ${AtomMatrix.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vl53l0x + [env:test_UnitToF_AtomS3] extends=AtomS3, option_release, arduino_latest lib_deps = ${AtomS3.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vl53l0x +[env:test_UnitToF_AtomS3R] +extends=AtomS3R, option_release, arduino_latest +lib_deps = ${AtomS3R.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vl53l0x + [env:test_UnitToF_NanoC6] extends=NanoC6, option_release, arduino_latest lib_deps = ${NanoC6.lib_deps} @@ -278,12 +333,23 @@ lib_deps = ${StickCPlus.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vl53l0x +[env:test_UnitToF_StickCPlus2] +extends=StickCPlus2, option_release, arduino_latest +lib_deps = ${StickCPlus2.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vl53l0x + [env:test_UnitToF_Paper] extends=Paper, option_release, arduino_latest lib_deps = ${Paper.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vl53l0x +[env:test_UnitToF_CoreInk] +extends=CoreInk, option_release, arduino_latest +lib_deps = ${CoreInk.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vl53l0x ; -------------------------------- ;Examples by M5UnitUnified @@ -333,10 +399,18 @@ build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/Pl extends=StampS3, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/PlotToSerial> +[env:UnitToF4M_PlotToSerial_AtomMatrix_Arduino_latest] +extends=AtomMatrix, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/PlotToSerial> + [env:UnitToF4M_PlotToSerial_AtomS3_Arduino_latest] extends=AtomS3, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/PlotToSerial> +[env:UnitToF4M_PlotToSerial_AtomS3R_Arduino_latest] +extends=AtomS3R, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/PlotToSerial> + [env:UnitToF4M_PlotToSerial_Dial_Arduino_latest] extends=Dial, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/PlotToSerial> @@ -349,10 +423,18 @@ build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/Pl extends=StickCPlus, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/PlotToSerial> +[env:UnitToF4M_PlotToSerial_StickCPlus2_Arduino_latest] +extends=StickCPlus2, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/PlotToSerial> + [env:UnitToF4M_PlotToSerial_Paper_Arduino_latest] extends=Paper, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/PlotToSerial> +[env:UnitToF4M_PlotToSerial_CoreInk_Arduino_latest] +extends=CoreInk, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF4M/PlotToSerial> + ;UnitToF [env:UnitToF_PlotToSerial_Core_Arduino_latest] extends=Core, option_release, arduino_latest @@ -398,10 +480,18 @@ build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/Plot extends=StampS3, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/PlotToSerial> +[env:UnitToF_PlotToSerial_AtomMatrix_Arduino_latest] +extends=AtomMatrix, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/PlotToSerial> + [env:UnitToF_PlotToSerial_AtomS3_Arduino_latest] extends=AtomS3, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/PlotToSerial> +[env:UnitToF_PlotToSerial_AtomS3R_Arduino_latest] +extends=AtomS3R, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/PlotToSerial> + [env:UnitToF_PlotToSerial_Dial_Arduino_latest] extends=Dial, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/PlotToSerial> @@ -414,6 +504,14 @@ build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/Plot extends=StickCPlus, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/PlotToSerial> +[env:UnitToF_PlotToSerial_StickCPlus2_Arduino_latest] +extends=StickCPlus2, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/PlotToSerial> + [env:UnitToF_PlotToSerial_Paper_Arduino_latest] extends=Paper, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/PlotToSerial> + +[env:UnitToF_PlotToSerial_CoreInk_Arduino_latest] +extends=CoreInk, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitToF/PlotToSerial> diff --git a/src/M5UnitUnifiedToF.h b/src/M5UnitUnifiedTOF.h similarity index 91% rename from src/M5UnitUnifiedToF.h rename to src/M5UnitUnifiedTOF.h index e149b6e..abcb254 100644 --- a/src/M5UnitUnifiedToF.h +++ b/src/M5UnitUnifiedTOF.h @@ -9,7 +9,7 @@ #ifndef M5_UNIT_UNIFIED_TOF_H #define M5_UNIT_UNIFIED_TOF_H #ifdef __cplusplus -#include "M5UnitUnifiedToF.hpp" +#include "M5UnitUnifiedTOF.hpp" #else #error M5UnitUnifiedToF requires a C++ compiler, please change file extension to .cc or .cpp #endif diff --git a/src/M5UnitUnifiedToF.hpp b/src/M5UnitUnifiedTOF.hpp similarity index 89% rename from src/M5UnitUnifiedToF.hpp rename to src/M5UnitUnifiedTOF.hpp index 40ed5c0..8823b83 100644 --- a/src/M5UnitUnifiedToF.hpp +++ b/src/M5UnitUnifiedTOF.hpp @@ -7,8 +7,8 @@ @file M5UnitUnifiedToF.hpp @brief Main header of M5UnitToF - @mainpage M5UnitToF - Library for UnitToF using M5UnitUnified. + @mainpage M5Unit-TOF + Library for UnitTOF using M5UnitUnified. */ #ifndef M5_UNIT_UNIFIED_TOF_HPP #define M5_UNIT_UNIFIED_TOF_HPP diff --git a/src/unit/.#unit_VL53L0X.hpp b/src/unit/.#unit_VL53L0X.hpp new file mode 120000 index 0000000..87c91ba --- /dev/null +++ b/src/unit/.#unit_VL53L0X.hpp @@ -0,0 +1 @@ +gob@gob-mbp.local.6886 \ No newline at end of file diff --git a/src/unit/unit_VL53L0X.cpp b/src/unit/unit_VL53L0X.cpp index fa9f01c..6b54e94 100644 --- a/src/unit/unit_VL53L0X.cpp +++ b/src/unit/unit_VL53L0X.cpp @@ -434,7 +434,7 @@ bool UnitVL53L0X::softReset() if (soft_reset()) { _mode = Mode::Unknown; _periodic = false; - return begin(); + return true; } return false; } diff --git a/src/unit/unit_VL53L0X.hpp b/src/unit/unit_VL53L0X.hpp index 2a25a68..d094113 100644 --- a/src/unit/unit_VL53L0X.hpp +++ b/src/unit/unit_VL53L0X.hpp @@ -96,8 +96,7 @@ class UnitVL53L0X : public Component, public PeriodicMeasurementAdaptersoftReset()); EXPECT_TRUE(unit->readSignalRateLimit(tmp)); - EXPECT_NEAR(tmp, 0.25f, 0.0075f); // default + EXPECT_FLOAT_EQ(tmp, 0.0f); } TEST_P(TestVL53L0X, Singleshot) diff --git a/test/embedded/test_vl53l1x/vl53l1x_test.cpp b/test/embedded/test_vl53l1x/vl53l1x_test.cpp index 97d976b..883cf1b 100644 --- a/test/embedded/test_vl53l1x/vl53l1x_test.cpp +++ b/test/embedded/test_vl53l1x/vl53l1x_test.cpp @@ -218,6 +218,7 @@ TEST_P(TestVL53L1X, Reset) Timing tb{}; int16_t offset{}; uint16_t xtalk{}, ms{}; + EXPECT_FALSE(unit->inPeriodic()); EXPECT_TRUE(unit->readDistanceMode(d)); EXPECT_TRUE(unit->readTimingBudget(tb)); EXPECT_TRUE(unit->readInterMeasurementPeriod(ms)); @@ -259,13 +260,13 @@ TEST_P(TestVL53L1X, SingleShot) { SCOPED_TRACE(ustr); - Data d{}; + Data data{}; - EXPECT_FALSE(unit->measureSingleshot(d)); + EXPECT_FALSE(unit->measureSingleshot(data)); EXPECT_TRUE(unit->stopPeriodicMeasurement()); EXPECT_FALSE(unit->inPeriodic()); - for (auto&& d ::distance_table) { + for (auto&& d : distance_table) { std::vector results; SCOPED_TRACE(d == Distance::Long ? "Long" : "Short"); @@ -273,8 +274,8 @@ TEST_P(TestVL53L1X, SingleShot) uint32_t cnt{32}; while (cnt--) { - EXPECT_TRUE(unit->measureSingleshot(d)); - results.push_back(d.range()); + EXPECT_TRUE(unit->measureSingleshot(data)); + results.push_back(data.range()); } EXPECT_FALSE(results.empty());