Skip to content

Commit b9cc0e6

Browse files
authored
[CI] Boards test fix + sketch (espressif#8099)
* Fix test-board job condition * Add CIBoardsTest.ino and use it for boards test * Rename Test
1 parent 6b1cc41 commit b9cc0e6

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

.github/workflows/boards.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: New Board Test
1+
name: Boards Test
22

33
# The workflow will run on schedule and labeled pull requests
44
on:
@@ -30,7 +30,7 @@ jobs:
3030
test-boards:
3131
needs: find-boards
3232
runs-on: ubuntu-latest
33-
if: ${{ needs.changes.outputs.services != '' }}
33+
if: ${{ needs.find-boards.outputs.fqbns != '' }}
3434

3535
env:
3636
REPOSITORY: |
@@ -58,4 +58,4 @@ jobs:
5858
- --warnings="all"
5959
exit-on-fail: true
6060
sketch-paths:
61-
"- ./libraries/ESP32/examples/ChipID/GetChipID/GetChipID.ino"
61+
"- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#include <Wire.h>
2+
#include <SPI.h>
3+
4+
void setup() {
5+
// UART initialization
6+
Serial.begin(9600);
7+
8+
// I2C initialization
9+
Wire.begin();
10+
11+
// SPI initialization
12+
SPI.begin();
13+
}
14+
15+
void loop() {
16+
// UART echo
17+
if (Serial.available()) {
18+
Serial.write(Serial.read());
19+
}
20+
21+
// I2C read/write
22+
Wire.beginTransmission(0x68); // I2C address of device
23+
Wire.write(0x00); // register to read/write
24+
Wire.write(0xFF); // data to write (if writing)
25+
Wire.endTransmission();
26+
27+
Wire.requestFrom(0x68, 1); // number of bytes to read
28+
29+
while (Wire.available()) {
30+
Serial.println(Wire.read());
31+
}
32+
33+
// SPI read/write
34+
digitalWrite(SS, LOW); // select slave device
35+
SPI.transfer(0x01); // data to write
36+
digitalWrite(SS, HIGH); // deselect slave device
37+
38+
digitalWrite(SS, LOW); // select slave device
39+
byte data = SPI.transfer(0x00);// data to read
40+
digitalWrite(SS, HIGH); // deselect slave device
41+
42+
Serial.println(data);
43+
44+
delay(1000); // wait for 1 second before repeating loop
45+
}

0 commit comments

Comments
 (0)