[CI] Boards test fix + sketch (#8099)
* Fix test-board job condition * Add CIBoardsTest.ino and use it for boards test * Rename Test
This commit is contained in:
parent
6b1cc41305
commit
b9cc0e69a4
2 changed files with 48 additions and 3 deletions
6
.github/workflows/boards.yml
vendored
6
.github/workflows/boards.yml
vendored
|
|
@ -1,4 +1,4 @@
|
|||
name: New Board Test
|
||||
name: Boards Test
|
||||
|
||||
# The workflow will run on schedule and labeled pull requests
|
||||
on:
|
||||
|
|
@ -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: |
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
45
libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino
Normal file
45
libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#include <Wire.h>
|
||||
#include <SPI.h>
|
||||
|
||||
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
|
||||
}
|
||||
Loading…
Reference in a new issue