Skip to content

Commit 6f556e2

Browse files
committed
add run-cl-arduino.yml and add SERIAL_PORT_MONITOR define
1 parent 4912837 commit 6f556e2

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Run Ci Arduino
2+
3+
on:
4+
push:
5+
pull_request:
6+
repository_dispatch:
7+
types: [trigger-workflow]
8+
9+
jobs:
10+
ci-arduino:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Checkout script repository
18+
uses: actions/checkout@v4
19+
with:
20+
repository: Seeed-Studio/ci-arduino
21+
path: ci
22+
23+
24+
- name: Setup arduino cli
25+
uses: arduino/[email protected]
26+
27+
- name: Create a depend.list file
28+
run: |
29+
# eg: echo "<repo>" >> depend.list
30+
echo "arduino-libraries/SD" >> depend.list
31+
echo "frankjoshua/rosserial_arduino_lib" >> depend.list
32+
33+
34+
- name: Create a ignore.list file
35+
run: |
36+
# eg: echo "<path>,<fqbn>" >> ignore.list
37+
38+
# ROS library has some issue with std_msg, so we ignore them,waiting for the fix
39+
40+
echo "send_Blink_ROS,Seeeduino:samd:seeed_XIAO_m0" >> ignore.list
41+
echo "send_Blink_ROS,Seeeduino:nrf52:xiaonRF52840" >> ignore.list
42+
echo "send_Blink_ROS,Seeeduino:nrf52:xiaonRF52840Sense" >> ignore.list
43+
echo "send_Blink_ROS,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
44+
echo "send_Blink_ROS,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
45+
echo "send_Blink_ROS,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
46+
echo "send_Blink_ROS,esp32:esp32:XIAO_ESP32C3" >> ignore.list
47+
echo "send_Blink_ROS,esp32:esp32:XIAO_ESP32C6" >> ignore.list
48+
echo "send_Blink_ROS,esp32:esp32:XIAO_ESP32S3" >> ignore.list
49+
50+
echo "receive_sleep,Seeeduino:samd:seeed_XIAO_m0" >> ignore.list
51+
echo "receive_sleep,Seeeduino:nrf52:xiaonRF52840" >> ignore.list
52+
echo "receive_sleep,Seeeduino:nrf52:xiaonRF52840Sense" >> ignore.list
53+
echo "receive_sleep,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
54+
echo "receive_sleep,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
55+
echo "receive_sleep,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
56+
echo "receive_sleep,esp32:esp32:XIAO_ESP32C3" >> ignore.list
57+
echo "receive_sleep,esp32:esp32:XIAO_ESP32C6" >> ignore.list
58+
echo "receive_sleep,esp32:esp32:XIAO_ESP32S3" >> ignore.list
59+
60+
61+
echo "send_sleep,Seeeduino:samd:seeed_XIAO_m0" >> ignore.list
62+
echo "send_sleep,Seeeduino:nrf52:xiaonRF52840" >> ignore.list
63+
echo "send_sleep,Seeeduino:nrf52:xiaonRF52840Sense" >> ignore.list
64+
echo "send_sleep,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
65+
echo "send_sleep,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
66+
echo "send_sleep,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
67+
echo "send_sleep,esp32:esp32:XIAO_ESP32C3" >> ignore.list
68+
echo "send_sleep,esp32:esp32:XIAO_ESP32C6" >> ignore.list
69+
echo "send_sleep,esp32:esp32:XIAO_ESP32S3" >> ignore.list
70+
71+
72+
73+
- name: Build sketch
74+
run: ./ci/tools/compile.sh
75+
76+
- name: Build result
77+
run: |
78+
cat build.log
79+
if [ ${{ github.event_name }} == 'pull_request' ] && [ -f compile.failed ]; then
80+
exit 1
81+
fi
82+
83+
- name: Generate issue
84+
if: ${{ github.event_name != 'pull_request' }}
85+
run: ./ci/tools/issue.sh
86+
env:
87+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

examples/receive_interruptFD/receive_interruptFD.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ void setup() {
4848
}
4949
SERIAL_PORT_MONITOR.println("CAN init ok!");
5050
byte mode = CAN.getMode();
51+
#ifdef ARDUINO_XIAO_RA4M1
52+
char buffer[50];
53+
sprintf(buffer, "CAN BUS mode = %d\n\r", mode);
54+
SERIAL_PORT_MONITOR.print(buffer);
55+
#else
5156
SERIAL_PORT_MONITOR.printf("CAN BUS mode = %d\n\r", mode);
57+
#endif
5258
}
5359

5460
void MCP2515_ISR() {

src/mcp_can.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
#include <SPI.h>
66
#include <inttypes.h>
77

8+
#ifndef SERIAL_PORT_MONITOR
9+
10+
#ifdef SEEED_XIAO_M0
11+
#define SERIAL_PORT_MONITOR Serial
12+
#elif defined(ARDUINO_SAMD_VARIANT_COMPLIANCE)
13+
#define SERIAL_PORT_MONITOR SerialUSB
14+
#else
15+
#define SERIAL_PORT_MONITOR Serial
16+
#endif
17+
18+
#endif
19+
20+
821
#define CAN_OK (0)
922
#define CAN_FAILINIT (1)
1023
#define CAN_FAILTX (2)

0 commit comments

Comments
 (0)