diff --git a/.github/workflows/ArduinoBuild_2.yml b/.github/workflows/ArduinoBuild_2.yml deleted file mode 100644 index 7c08da6..0000000 --- a/.github/workflows/ArduinoBuild_2.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: ArduinoBuild(platform-version 2.x) - -env: - SKETCH_NAMES_FIND_START: ./examples/UnitUnified - REQUIRED_LIBRARIES: M5Unified - M5UNITUNIFIED_BRANCH: main -# M5UNITUNIFIED_BRANCH: develop - -on: - push: - paths: - - '**.ino' - - '**.cpp' - - '**.hpp' - - '**.h' - - '**.c' - - '**ArduinoBuild_2.yml' - pull_request: - paths: - - '**.ino' - - '**.cpp' - - '**.hpp' - - '**.h' - - '**.c' - - '**ArduinoBuild_2.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://espressif.github.io/arduino-esp32/package_esp32_index.json - - unit: - - UnitAmeter - - UnitVmeter - - UnitKMeterISO - - sketch: - - PlotToSerial - - board: - - m5stack-core-esp32 - - m5stack-core2 - - m5stack-atoms3 - - m5stack-cores3 - - platform-version: - #- 2.0.15 - #- 2.0.16 - - 2.0.17 - - platform: - - esp32 - - archi: - - esp32 - - steps: - - - name: Running on GitHub Actions - if: env.ACT != 'true' - run: echo "This is running on GitHub Actions." - - - name: Running locally with act - if: env.ACT == 'true' - run: echo "This is running locally with act." - -# - name: Configure git for authentication (Until each repository is published) -# run: | -# git config --global url."https://${{ secrets.TOKEN_M5UNITUNIFIED }}@github.com/".insteadOf "https://github.com/" - - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - # Checkout library from specific URL and branch - # Note that dependent libraries are not automatically installed. - - - name: Checkout M5Utility - uses: actions/checkout@v3 - with: - repository: m5stack/M5Utility - ref: ${{ env.M5UNITUNIFIED_BRANCH }} - path: CustomLibrary_M5Utility # must contain string "Custom" - token: ${{ secrets.TOKEN_M5UNITUNIFIED }} # Only required during development in private repo - - - name: Checkout M5HAL - uses: actions/checkout@v3 - with: - repository: m5stack/M5HAL - ref: ${{ env.M5UNITUNIFIED_BRANCH }} - path: CustomLibrary_M5HAL # must contain string "Custom" - token: ${{ secrets.TOKEN_M5UNITUNIFIED }} # Only required during development in private repo - - - name: Checkout M5UnitUnified - uses: actions/checkout@v3 - with: - repository: m5stack/M5UnitUnified - ref: ${{ env.M5UNITUNIFIED_BRANCH }} - path: CustomLibrary_M5UnitUnified - token: ${{ secrets.TOKEN_M5UNITUNIFIED }} # Only required during development in private repo - - # 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/ArduinoBuild_3.yml b/.github/workflows/ArduinoBuild_3.yml deleted file mode 100644 index 455614e..0000000 --- a/.github/workflows/ArduinoBuild_3.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: ArduinoBuild(platform-version 3.x) - -env: - SKETCH_NAMES_FIND_START: ./examples/UnitUnified - REQUIRED_LIBRARIES: M5Unified -# M5UNITUNIFIED_BRANCH: main - M5UNITUNIFIED_BRANCH: develop - -on: - push: - paths: - - '**.ino' - - '**.cpp' - - '**.hpp' - - '**.h' - - '**.c' - - '**ArduinoBuild_3.yml' - pull_request: - paths: - - '**.ino' - - '**.cpp' - - '**.hpp' - - '**.h' - - '**.c' - - '**ArduinoBuild_3.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://espressif.github.io/arduino-esp32/package_esp32_index.json - - unit: - - UnitAmeter - - UnitVmeter - - UnitKMeterISO - - sketch: - - PlotToSerial - - board: - - m5stack_core - - m5stack_core2 - - m5stack_atoms3 - - m5stack_cores3 - - m5stack_dial - - m5stack_nanoc6 - - m5stack_paper - - m5stack_stickc_plus - - platform-version: - #- 3.0.0 - #- 3.0.1 - #- 3.0.2 - #- 3.0.3 - - 3.0.4 - - platform: - - esp32 - - archi: - - esp32 - - steps: - - - name: Running on GitHub Actions - if: env.ACT != 'true' - run: echo "This is running on GitHub Actions." - - - name: Running locally with act - if: env.ACT == 'true' - run: echo "This is running locally with act." - -# - name: Configure git for authentication (Until each repository is published) -# run: | -# git config --global url."https://${{ secrets.TOKEN_M5UNITUNIFIED }}@github.com/".insteadOf "https://github.com/" - - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - # Checkout library from specific URL and branch - # Note that dependent libraries are not automatically installed. - - - - name: Checkout M5Utility - uses: actions/checkout@v3 - with: - repository: m5stack/M5Utility - ref: ${{ env.M5UNITUNIFIED_BRANCH }} - path: CustomLibrary_M5Utility # must contain string "Custom" - token: ${{ secrets.TOKEN_M5UNITUNIFIED }} # Only required during development in private repo - - - name: Checkout M5HAL - uses: actions/checkout@v3 - with: - repository: m5stack/M5HAL - ref: ${{ env.M5UNITUNIFIED_BRANCH }} - path: CustomLibrary_M5HAL # must contain string "Custom" - token: ${{ secrets.TOKEN_M5UNITUNIFIED }} # Only required during development in private repo - - - name: Checkout M5UnitUnified - uses: actions/checkout@v3 - with: - repository: m5stack/M5UnitUnified - ref: ${{ env.M5UNITUNIFIED_BRANCH }} - path: CustomLibrary_M5UnitUnified - token: ${{ secrets.TOKEN_M5UNITUNIFIED }} # Only required during development in private repo - - # 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/PlatformioBuild.yml b/.github/workflows/PlatformioBuild.yml deleted file mode 100644 index 5ef30a7..0000000 --- a/.github/workflows/PlatformioBuild.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: PlatformIOBuild - -on: - push: - paths: - - '**.ino' - - '**.cpp' - - '**.hpp' - - '**.h' - - '**.c' - - '**PlatformioBuild.yml' - - '**platformio.ini' - pull_request: - paths: - - '**.ino' - - '**.cpp' - - '**.hpp' - - '**.h' - - '**.c' - - '**PlatformioBuild.yml' - - '**platformio.ini' - workflow_dispatch: - -jobs: - build: - name: ${{ matrix.unit }}:${{ matrix.example }}:${{ matrix.board }}:${{ matrix.framework }}@${{ matrix.espressif32 }} -# name: ${{ matrix.unit }}_${{ matrix.example }}_${{ matrix.board }}_${{ matrix.framework }}_${{ matrix.espressif32 }} - runs-on: ubuntu-latest - - strategy: - fail-fast: false - #max-parallel: 1 - - matrix: - unit: - - UnitAmeter - - UnitVmeter - - UnitKmeterISO - - example: - - PlotToSerial - - board: - - Core - - Core2 - - CoreS3 - - StampS3 - - AtomS3 - - Dial - - NanoC6 - - StickCPlus - - Paper - - Fire - - framework: - - Arduino - - espressif32: - - latest - - '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' - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Configure git for authentication (Until each repository is published) - run: | - git config --global url."https://${{ secrets.TOKEN_M5UNITUNIFIED }}@github.com/".insteadOf "https://github.com/" - - - name: Build examples - uses: karniv00l/platformio-run-action@v1 - with: - environments: ${{ matrix.unit }}_${{ matrix.example }}_${{ matrix.board }}_${{ matrix.framework }}_${{ matrix.espressif32 }} - #targets: - project-dir: "./" - project-conf: "./platformio.ini" - #jobs: 6 - #silent: false - #verbose: truee - #disable-auto-clean: false diff --git a/.github/workflows/arduino-esp-v2-build-check.yml b/.github/workflows/arduino-esp-v2-build-check.yml new file mode 100644 index 0000000..67584b4 --- /dev/null +++ b/.github/workflows/arduino-esp-v2-build-check.yml @@ -0,0 +1,103 @@ +name: Build(arduino-esp32:2.x) + +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-esp-v2-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-esp-v2-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://espressif.github.io/arduino-esp32/package_esp32_index.json + + sketch: + - PlotToSerial + + unit: + - UnitAmeter + - UnitVmeter + - UnitKmeterISO + + board: + - m5stack-atom + - m5stack-atoms3 + - m5stack-core-esp32 + - m5stack-core2 + - m5stack-coreink + - m5stack-cores3 + - m5stack-fire + + platform-version: + - 2.0.17 + + platform: + - esp32 + + 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/arduino-esp-v3-build-check.yml b/.github/workflows/arduino-esp-v3-build-check.yml new file mode 100644 index 0000000..bcbdf3f --- /dev/null +++ b/.github/workflows/arduino-esp-v3-build-check.yml @@ -0,0 +1,119 @@ +name: Build(arduino-esp32:3.x) + +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-esp-v3-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-esp-v3-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://espressif.github.io/arduino-esp32/package_esp32_index.json + + sketch: + - PlotToSerial + + unit: + - UnitAmeter + - UnitVmeter + - UnitKmeterISO + + board: + - m5stack_atom + - m5stack_atoms3 + - m5stack_capsule +# - m5stack_cardputer + - m5stack_core + - m5stack_core2 + - 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.4 + + platform: + - esp32 + + 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/arduino-m5-build-check.yml b/.github/workflows/arduino-m5-build-check.yml new file mode 100644 index 0000000..9bd03ff --- /dev/null +++ b/.github/workflows/arduino-m5-build-check.yml @@ -0,0 +1,122 @@ +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: + - UnitAmeter + - UnitVmeter + - UnitKmeterISO + + 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 0b6b959..13f125f 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -5,6 +5,11 @@ env: on: push: + tags-ignore: + - '*.*.*' + - 'v*.*.*' + branches: + - '*' paths: - '**.ino' - '**.cpp' @@ -13,7 +18,9 @@ on: - '**.c' - '**.inl' - '**clang-format-check.yml' - pull_request: + - '**.clang-format' + pull_request: + paths: - '**.ino' - '**.cpp' - '**.hpp' @@ -21,6 +28,8 @@ on: - '**.c' - '**.inl' - '**clang-format-check.yml' + - '**.clang-format' + workflow_dispatch: jobs: formatting-check: @@ -29,15 +38,15 @@ jobs: strategy: matrix: path: - #- check: './' # path to include - # exclude: '' # path to exclude - check: 'src' + exclude: '' - check: 'test' + exclude: '' - check: 'examples' - # exclude: '(Fonts)' # Exclude file paths containing "Fonts" + exclude: '' steps: - - name: Checkout # When pull_request is used, include it in the checkout https://zenn.dev/hkusu/articles/c731862051438b + - name: Checkout uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} diff --git a/.github/workflows/platformio-build-check.yml b/.github/workflows/platformio-build-check.yml new file mode 100644 index 0000000..f1b9b53 --- /dev/null +++ b/.github/workflows/platformio-build-check.yml @@ -0,0 +1,133 @@ +name: Build(platformio) + +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' + - '/platformio-build-check.yml' + - '**platformio.ini' + 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' + - '**/platformio-build-check.yml' + - '**platformio.ini' + workflow_dispatch: + +jobs: + build: + name: ${{ matrix.unit }}:${{ matrix.example }}@${{ matrix.board }}:${{ matrix.framework }}:${{ matrix.espressif32 }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + #max-parallel: 1 + + matrix: + example: + - PlotToSerial + + unit: + - UnitAmeter + - UnitVmeter + - UnitKmeterISO + + board: + - Core + - Core2 + - CoreS3 + - Fire + - StampS3 + - Dial + - AtomMatrix + - AtomS3 + - AtomS3R + - NanoC6 + - StickCPlus + - StickCPlus2 + - Paper + - CoreInk + + framework: + - Arduino + + espressif32: + - latest +# - '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' + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Build examples + uses: karniv00l/platformio-run-action@v1 + with: + 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 diff --git a/README.md b/README.md index 585aa38..4b8f493 100644 --- a/README.md +++ b/README.md @@ -49,12 +49,14 @@ See also examples using conventional methods here. ## License -- [M5Unit-METER- MIT](LICENSE) +- [M5Unit-METER - MIT](LICENSE) ## Examples See also [examples/UnitUnified](examples/UnitUnified) ## Doxygen document +[GitHub Pages](https://m5stack.github.io/M5Unit-METER/) + 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/UnitKMeterISO/PlotToSerial/PlotToSerial.ino b/examples/UnitUnified/UnitKmeterISO/PlotToSerial/PlotToSerial.ino similarity index 100% rename from examples/UnitUnified/UnitKMeterISO/PlotToSerial/PlotToSerial.ino rename to examples/UnitUnified/UnitKmeterISO/PlotToSerial/PlotToSerial.ino diff --git a/examples/UnitUnified/UnitKMeterISO/PlotToSerial/main/PlotToSerial.cpp b/examples/UnitUnified/UnitKmeterISO/PlotToSerial/main/PlotToSerial.cpp similarity index 89% rename from examples/UnitUnified/UnitKMeterISO/PlotToSerial/main/PlotToSerial.cpp rename to examples/UnitUnified/UnitKmeterISO/PlotToSerial/main/PlotToSerial.cpp index 67bdab3..db503c7 100644 --- a/examples/UnitUnified/UnitKMeterISO/PlotToSerial/main/PlotToSerial.cpp +++ b/examples/UnitUnified/UnitKmeterISO/PlotToSerial/main/PlotToSerial.cpp @@ -26,8 +26,6 @@ void setup() { M5.begin(); - m5::utility::delay(3000); - auto pin_num_sda = M5.getPin(m5::pin_name_t::port_a_sda); auto pin_num_scl = M5.getPin(m5::pin_name_t::port_a_scl); M5_LOGI("getPin: SDA:%u SCL:%u", pin_num_sda, pin_num_scl); @@ -51,13 +49,6 @@ void setup() #pragma message "Using Wire" // Using TwoWire Wire.begin(pin_num_sda, pin_num_scl, 100000U); - for (int i = 0; i < 10; ++i) { - Wire.beginTransmission(unit.address()); - auto wret = Wire.endTransmission(); - M5_LOGW(">>%d", wret); - delay(10); - } - if (!Units.add(unit, Wire) || !Units.begin()) { M5_LOGE("Failed to begin"); lcd.clear(TFT_RED); diff --git a/library.json b/library.json index 60005f3..3e80f18 100644 --- a/library.json +++ b/library.json @@ -13,7 +13,7 @@ "dependencies": { "M5UnitUnified": "https://github.com/m5stack/M5UnitUnified.git" }, - "version": "0.0.1", + "version": "0.0.2", "frameworks": [ "arduino" ], @@ -23,9 +23,8 @@ "headers": "M5UnitUnifiedMETER.h", "license": "MIT", "export": { - "exclude": - [ + "exclude": [ "docs/html" ] } -} +} \ No newline at end of file diff --git a/library.properties b/library.properties index bf28d98..c3382d2 100644 --- a/library.properties +++ b/library.properties @@ -1,9 +1,9 @@ name=M5Unit-METER -version=0.0.1 +version=0.0.2 author=M5Stack maintainer=M5Stack sentence=Library for M5Stack UNIT METER using M5UnitUnified -paragraph= +paragraph=See more on http://M5Stack.com category=Device Control url=https://github.com/m5stack/M5Unit-METER architectures=esp32 diff --git a/platformio.ini b/platformio.ini index c94b126..020c846 100644 --- a/platformio.ini +++ b/platformio.ini @@ -3,9 +3,6 @@ ; For UnitTest and examples (Using M5UnitUnified) ;----------------------------------------------------------------------- [platformio] -;default_envs = test_Ameter_Core, test_Ameter_Core2, test_Ameter_CoreS3, test_Ameter_Fire, test_Ameter_StampS3, test_Ameter_Dial, test_Ameter_AtomS3, test_Ameter_NanoC6, test_Ameter_StickCPlus, test_Ameter_Paper, test_Vmeter_Core, test_Vmeter_Core2, test_Vmeter_CoreS3, test_Vmeter_Fire, test_Vmeter_StampS3, test_Vmeter_Dial, test_Vmeter_AtomS3, test_Vmeter_NanoC6, test_Vmeter_StickCPlus, test_Vmeter_Paper, test_UnitKmeterISO_Core, test_UnitKmeterISO_Core2, test_UnitKmeterISO_CoreS3, test_UnitKmeterISO_Fire, test_UnitKmeterISO_StampS3, test_UnitKmeterISO_Dial, test_UnitKmeterISO_AtomS3, test_UnitKmeterISO_NanoC6, test_UnitKmeterISO_StickCPlus, test_UnitKmeterISO_Paper -;default_envs = UnitAmeter_PlotToSerial_Core_Arduino_latest, UnitAmeter_PlotToSerial_Core_Arduino_5_4_0, UnitAmeter_PlotToSerial_Core_Arduino_4_4_0, UnitAmeter_PlotToSerial_Core2_Arduino_latest, UnitAmeter_PlotToSerial_Core2_Arduino_5_4_0, UnitAmeter_PlotToSerial_Core2_Arduino_4_4_0, UnitAmeter_PlotToSerial_CoreS3_Arduino_latest, UnitAmeter_PlotToSerial_StampS3_Arduino_latest, UnitAmeter_PlotToSerial_AtomS3_Arduino_latest, UnitAmeter_PlotToSerial_Dial_Arduino_latest, UnitAmeter_PlotToSerial_NanoC6_Arduino_latest, UnitAmeter_PlotToSerial_StickCPlus_Arduino_latest, UnitAmeter_PlotToSerial_Paper_Arduino_latest, UnitAmeter_PlotToSerial_Fire_Arduino_latest, UnitAmeter_PlotToSerial_Fire_Arduino_5_4_0, UnitAmeter_PlotToSerial_Fire_Arduino_4_4_0, UnitVmeter_PlotToSerial_Core_Arduino_latest, UnitVmeter_PlotToSerial_Core_Arduino_5_4_0, UnitVmeter_PlotToSerial_Core_Arduino_4_4_0, UnitVmeter_PlotToSerial_Core2_Arduino_latest, UnitVmeter_PlotToSerial_Core2_Arduino_5_4_0, UnitVmeter_PlotToSerial_Core2_Arduino_4_4_0, UnitVmeter_PlotToSerial_CoreS3_Arduino_latest, UnitVmeter_PlotToSerial_StampS3_Arduino_latest, UnitVmeter_PlotToSerial_AtomS3_Arduino_latest, UnitVmeter_PlotToSerial_Dial_Arduino_latest, UnitVmeter_PlotToSerial_NanoC6_Arduino_latest, UnitVmeter_PlotToSerial_StickCPlus_Arduino_latest, UnitVmeter_PlotToSerial_Paper_Arduino_latest, UnitVmeter_PlotToSerial_Fire_Arduino_latest, UnitVmeter_PlotToSerial_Fire_Arduino_5_4_0, UnitVmeter_PlotToSerial_Fire_Arduino_4_4_0, UnitKmeterISO_PlotToSerial_Core_Arduino_latest, UnitKmeterISO_PlotToSerial_Core_Arduino_5_4_0, UnitKmeterISO_PlotToSerial_Core_Arduino_4_4_0, UnitKmeterISO_PlotToSerial_Core2_Arduino_latest, UnitKmeterISO_PlotToSerial_Core2_Arduino_5_4_0, UnitKmeterISO_PlotToSerial_Core2_Arduino_4_4_0, UnitKmeterISO_PlotToSerial_CoreS3_Arduino_latest, UnitKmeterISO_PlotToSerial_StampS3_Arduino_latest, UnitKmeterISO_PlotToSerial_AtomS3_Arduino_latest, UnitKmeterISO_PlotToSerial_Dial_Arduino_latest, UnitKmeterISO_PlotToSerial_NanoC6_Arduino_latest, UnitKmeterISO_PlotToSerial_StickCPlus_Arduino_latest, UnitKmeterISO_PlotToSerial_Paper_Arduino_latest, UnitKmeterISO_PlotToSerial_Fire_Arduino_latest, UnitKmeterISO_PlotToSerial_Fire_Arduino_5_4_0, UnitKmeterISO_PlotToSerial_Fire_Arduino_4_4_0 - [env] build_flags =-Wall -Wextra -Wreturn-local-addr -Werror=format -Werror=return-local-addr @@ -46,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} @@ -57,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 @@ -78,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] @@ -204,12 +222,24 @@ lib_deps = ${Dial.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_ameter +[env:test_Ameter_AtomMatrix] +extends=AtomMatrix, option_release, arduino_latest +lib_deps = ${AtomMatrix.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_ameter + [env:test_Ameter_AtomS3] extends=AtomS3, option_release, arduino_latest lib_deps = ${AtomS3.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_ameter +[env:test_Ameter_AtomS3R] +extends=AtomS3R, option_release, arduino_latest +lib_deps = ${AtomS3R.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_ameter + [env:test_Ameter_NanoC6] extends=NanoC6, option_release, arduino_latest lib_deps = ${NanoC6.lib_deps} @@ -222,12 +252,24 @@ lib_deps = ${StickCPlus.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_ameter +[env:test_Ameter_StickCPlus2] +extends=StickCPlus2, option_release, arduino_latest +lib_deps = ${StickCPlus2.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_ameter + [env:test_Ameter_Paper] extends=Paper, option_release, arduino_latest lib_deps = ${Paper.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_ameter +[env:test_Ameter_CoreInk] +extends=CoreInk, option_release, arduino_latest +lib_deps = ${CoreInk.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_ameter + ; Vmeter [env:test_Vmeter_Core] extends=Core, option_release, arduino_latest @@ -265,12 +307,24 @@ lib_deps = ${Dial.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vmeter +[env:test_Vmeter_AtomMatrix] +extends=AtomMatrix, option_release, arduino_latest +lib_deps = ${AtomMatrix.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vmeter + [env:test_Vmeter_AtomS3] extends=AtomS3, option_release, arduino_latest lib_deps = ${AtomS3.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vmeter +[env:test_Vmeter_AtomS3R] +extends=AtomS3R, option_release, arduino_latest +lib_deps = ${AtomS3R.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vmeter + [env:test_Vmeter_NanoC6] extends=NanoC6, option_release, arduino_latest lib_deps = ${NanoC6.lib_deps} @@ -283,12 +337,24 @@ lib_deps = ${StickCPlus.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vmeter +[env:test_Vmeter_StickCPlus2] +extends=StickCPlus2, option_release, arduino_latest +lib_deps = ${StickCPlus2.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vmeter + [env:test_Vmeter_Paper] extends=Paper, option_release, arduino_latest lib_deps = ${Paper.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_vmeter +[env:test_Vmeter_CoreInk] +extends=CoreInk, option_release, arduino_latest +lib_deps = ${CoreInk.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_vmeter + ; KMeterISO [env:test_UnitKmeterISO_Core] extends=Core, option_release, arduino_latest @@ -326,12 +392,24 @@ lib_deps = ${Dial.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_kmeterISO +[env:test_UnitKmeterISO_AtomMatrix] +extends=AtomMatrix, option_release, arduino_latest +lib_deps = ${AtomMatrix.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_kmeterISO + [env:test_UnitKmeterISO_AtomS3] extends=AtomS3, option_release, arduino_latest lib_deps = ${AtomS3.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_kmeterISO +[env:test_UnitKmeterISO_AtomS3R] +extends=AtomS3R, option_release, arduino_latest +lib_deps = ${AtomS3R.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_kmeterISO + [env:test_UnitKmeterISO_NanoC6] extends=NanoC6, option_release, arduino_latest lib_deps = ${NanoC6.lib_deps} @@ -344,12 +422,24 @@ lib_deps = ${StickCPlus.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_kmeterISO +[env:test_UnitKmeterISO_StickCPlus2] +extends=StickCPlus2, option_release, arduino_latest +lib_deps = ${StickCPlus2.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_kmeterISO + [env:test_UnitKmeterISO_Paper] extends=Paper, option_release, arduino_latest lib_deps = ${Paper.lib_deps} ${test_fw.lib_deps} test_filter= embedded/test_kmeterISO +[env:test_UnitKmeterISO_CoreInk] +extends=CoreInk, option_release, arduino_latest +lib_deps = ${CoreInk.lib_deps} + ${test_fw.lib_deps} +test_filter= embedded/test_kmeterISO + ; -------------------------------- ;Examples by M5UnitUnified ; -------------------------------- @@ -386,10 +476,18 @@ build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/P extends=StampS3, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/PlotToSerial> +[env:UnitAmeter_PlotToSerial_AtomMatrix_Arduino_latest] +extends=AtomMatrix, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/PlotToSerial> + [env:UnitAmeter_PlotToSerial_AtomS3_Arduino_latest] extends=AtomS3, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/PlotToSerial> +[env:UnitAmeter_PlotToSerial_AtomS3R_Arduino_latest] +extends=AtomS3R, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/PlotToSerial> + [env:UnitAmeter_PlotToSerial_Dial_Arduino_latest] extends=Dial, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/PlotToSerial> @@ -402,10 +500,18 @@ build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/P extends=StickCPlus, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/PlotToSerial> +[env:UnitAmeter_PlotToSerial_StickCPlus2_Arduino_latest] +extends=StickCPlus2, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/PlotToSerial> + [env:UnitAmeter_PlotToSerial_Paper_Arduino_latest] extends=Paper, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/PlotToSerial> +[env:UnitAmeter_PlotToSerial_CoreInk_Arduino_latest] +extends=CoreInk, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/PlotToSerial> + [env:UnitAmeter_PlotToSerial_Fire_Arduino_latest] extends=Fire, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitAmeter/PlotToSerial> @@ -451,10 +557,18 @@ build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/P extends=StampS3, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/PlotToSerial> +[env:UnitVmeter_PlotToSerial_AtomMatrix_Arduino_latest] +extends=AtomMatrix, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/PlotToSerial> + [env:UnitVmeter_PlotToSerial_AtomS3_Arduino_latest] extends=AtomS3, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/PlotToSerial> +[env:UnitVmeter_PlotToSerial_AtomS3R_Arduino_latest] +extends=AtomS3R, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/PlotToSerial> + [env:UnitVmeter_PlotToSerial_Dial_Arduino_latest] extends=Dial, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/PlotToSerial> @@ -467,10 +581,18 @@ build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/P extends=StickCPlus, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/PlotToSerial> +[env:UnitVmeter_PlotToSerial_StickCPlus2_Arduino_latest] +extends=StickCPlus2, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/PlotToSerial> + [env:UnitVmeter_PlotToSerial_Paper_Arduino_latest] extends=Paper, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/PlotToSerial> +[env:UnitVmeter_PlotToSerial_CoreInk_Arduino_latest] +extends=CoreInk, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/PlotToSerial> + [env:UnitVmeter_PlotToSerial_Fire_Arduino_latest] extends=Fire, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitVmeter/PlotToSerial> @@ -493,7 +615,7 @@ extends=Core, option_release, arduino_5_4_0 build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> [env:UnitKmeterISO_PlotToSerial_Core_Arduino_4_4_0] -extends=Core, option_release, arduino_5_4_0 +extends=Core, option_release, arduino_4_4_0 build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> [env:UnitKmeterISO_PlotToSerial_Core2_Arduino_latest] @@ -516,10 +638,18 @@ build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterIS extends=StampS3, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> +[env:UnitKmeterISO_PlotToSerial_AtomMatrix_Arduino_latest] +extends=AtomMatrix, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> + [env:UnitKmeterISO_PlotToSerial_AtomS3_Arduino_latest] extends=AtomS3, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> +[env:UnitKmeterISO_PlotToSerial_AtomS3R_Arduino_latest] +extends=AtomS3R, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> + [env:UnitKmeterISO_PlotToSerial_Dial_Arduino_latest] extends=Dial, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> @@ -532,10 +662,18 @@ build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterIS extends=StickCPlus, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> +[env:UnitKmeterISO_PlotToSerial_StickCPlus2_Arduino_latest] +extends=StickCPlus2, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> + [env:UnitKmeterISO_PlotToSerial_Paper_Arduino_latest] extends=Paper, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> +[env:UnitKmeterISO_PlotToSerial_CoreInk_Arduino_latest] +extends=CoreInk, option_release, arduino_latest +build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> + [env:UnitKmeterISO_PlotToSerial_Fire_Arduino_latest] extends=Fire, option_release, arduino_latest build_src_filter = +<*> -<.git/> -<.svn/> +<../examples/UnitUnified/UnitKmeterISO/PlotToSerial> diff --git a/src/unit/unit_KmeterISO.cpp b/src/unit/unit_KmeterISO.cpp index 08f83dc..88bad32 100644 --- a/src/unit/unit_KmeterISO.cpp +++ b/src/unit/unit_KmeterISO.cpp @@ -160,8 +160,8 @@ bool UnitKmeterISO::changeI2CAddress(const uint8_t i2c_address) bool done{}; auto timeout_at = m5::utility::millis() + 1000; do { - done = readRegister8(I2C_ADDRESS_REG, v, 0) && v == i2c_address; m5::utility::delay(1); + done = readRegister8(I2C_ADDRESS_REG, v, 0) && v == i2c_address; } while (!done && m5::utility::millis() <= timeout_at); return done; } diff --git a/test/embedded/avmeter_template.hpp b/test/embedded/avmeter_template.hpp index ed37471..2c72201 100644 --- a/test/embedded/avmeter_template.hpp +++ b/test/embedded/avmeter_template.hpp @@ -6,9 +6,6 @@ /* UnitTest for UnitADS111x */ - -// Move to each libarry - #include #include #include diff --git a/test/embedded/test_kmeterISO/kmeterISO_test.cpp b/test/embedded/test_kmeterISO/kmeterISO_test.cpp index 2c36c5d..d2f8d01 100644 --- a/test/embedded/test_kmeterISO/kmeterISO_test.cpp +++ b/test/embedded/test_kmeterISO/kmeterISO_test.cpp @@ -148,6 +148,8 @@ TEST_P(TestKmeterISO, I2CAddress) EXPECT_TRUE(unit->changeI2CAddress(0x08)); EXPECT_TRUE(unit->readI2CAddress(addr)); EXPECT_EQ(addr, 0x08); + EXPECT_EQ(unit->address(), 0x08); + EXPECT_TRUE(unit->readFirmwareVersion(ver)); EXPECT_NE(ver, 0x00); EXPECT_TRUE(unit->measureSingleshot(d)); @@ -156,6 +158,8 @@ TEST_P(TestKmeterISO, I2CAddress) EXPECT_TRUE(unit->changeI2CAddress(0x77)); EXPECT_TRUE(unit->readI2CAddress(addr)); EXPECT_EQ(addr, 0x77); + EXPECT_EQ(unit->address(), 0x77); + EXPECT_TRUE(unit->readFirmwareVersion(ver)); EXPECT_NE(ver, 0x00); EXPECT_TRUE(unit->measureSingleshot(d)); @@ -164,6 +168,8 @@ TEST_P(TestKmeterISO, I2CAddress) EXPECT_TRUE(unit->changeI2CAddress(0x52)); EXPECT_TRUE(unit->readI2CAddress(addr)); EXPECT_EQ(addr, 0x52); + EXPECT_EQ(unit->address(), 0x52); + EXPECT_TRUE(unit->readFirmwareVersion(ver)); EXPECT_NE(ver, 0x00); EXPECT_TRUE(unit->measureSingleshot(d)); @@ -172,6 +178,8 @@ TEST_P(TestKmeterISO, I2CAddress) EXPECT_TRUE(unit->changeI2CAddress(UnitKmeterISO::DEFAULT_ADDRESS)); EXPECT_TRUE(unit->readI2CAddress(addr)); EXPECT_EQ(addr, +UnitKmeterISO::DEFAULT_ADDRESS); + EXPECT_EQ(unit->address(), +UnitKmeterISO::DEFAULT_ADDRESS); + EXPECT_TRUE(unit->readFirmwareVersion(ver)); EXPECT_NE(ver, 0x00); EXPECT_TRUE(unit->measureSingleshot(d));