From cdfdc62ef73cb67ae59220b5d1ca604546f8feba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Tue, 18 Apr 2023 14:28:51 +0200 Subject: [PATCH 1/3] Fix test-board job condition --- .github/workflows/boards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/boards.yml b/.github/workflows/boards.yml index 9fda906439d..5f924ff89ae 100644 --- a/.github/workflows/boards.yml +++ b/.github/workflows/boards.yml @@ -30,7 +30,7 @@ jobs: test-boards: needs: find-boards runs-on: ubuntu-latest - if: ${{ needs.changes.outputs.services != '' }} + if: ${{ needs.find-boards.outputs.fqbns != '' }} env: REPOSITORY: | From 6500fa9d28433cdae67d7656e37948fc23ea5597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Wed, 19 Apr 2023 11:58:48 +0200 Subject: [PATCH 2/3] Add CIBoardsTest.ino and use it for boards test --- .github/workflows/boards.yml | 2 +- .../examples/CI/CIBoardsTest/CIBoardsTest.ino | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino diff --git a/.github/workflows/boards.yml b/.github/workflows/boards.yml index 5f924ff89ae..3c551b7ee92 100644 --- a/.github/workflows/boards.yml +++ b/.github/workflows/boards.yml @@ -58,4 +58,4 @@ jobs: - --warnings="all" exit-on-fail: true sketch-paths: - "- ./libraries/ESP32/examples/ChipID/GetChipID/GetChipID.ino" + "- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino" diff --git a/libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino b/libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino new file mode 100644 index 00000000000..6b2faa86120 --- /dev/null +++ b/libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino @@ -0,0 +1,45 @@ +#include +#include + +void setup() { + // UART initialization + Serial.begin(9600); + + // I2C initialization + Wire.begin(); + + // SPI initialization + SPI.begin(); +} + +void loop() { + // UART echo + if (Serial.available()) { + Serial.write(Serial.read()); + } + + // I2C read/write + Wire.beginTransmission(0x68); // I2C address of device + Wire.write(0x00); // register to read/write + Wire.write(0xFF); // data to write (if writing) + Wire.endTransmission(); + + Wire.requestFrom(0x68, 1); // number of bytes to read + + while (Wire.available()) { + Serial.println(Wire.read()); + } + + // SPI read/write + digitalWrite(SS, LOW); // select slave device + SPI.transfer(0x01); // data to write + digitalWrite(SS, HIGH); // deselect slave device + + digitalWrite(SS, LOW); // select slave device + byte data = SPI.transfer(0x00);// data to read + digitalWrite(SS, HIGH); // deselect slave device + + Serial.println(data); + + delay(1000); // wait for 1 second before repeating loop +} From a577247f5c6bea7e77441ca528e11c09c46a490c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Wed, 19 Apr 2023 12:03:25 +0200 Subject: [PATCH 3/3] Rename Test --- .github/workflows/boards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/boards.yml b/.github/workflows/boards.yml index 3c551b7ee92..e437936e6f1 100644 --- a/.github/workflows/boards.yml +++ b/.github/workflows/boards.yml @@ -1,4 +1,4 @@ -name: New Board Test +name: Boards Test # The workflow will run on schedule and labeled pull requests on: