mirror of
https://github.com/Seeed-Studio/Seeed_Arduino_CAN.git
synced 2026-07-27 19:55:59 +00:00
add run-cl-arduino.yml and add SERIAL_PORT_MONITOR define
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
name: Run Ci Arduino
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [trigger-workflow]
|
||||
|
||||
jobs:
|
||||
ci-arduino:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout script repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: Seeed-Studio/ci-arduino
|
||||
path: ci
|
||||
|
||||
|
||||
- name: Setup arduino cli
|
||||
uses: arduino/setup-arduino-cli@v2.0.0
|
||||
|
||||
- name: Create a depend.list file
|
||||
run: |
|
||||
# eg: echo "<repo>" >> depend.list
|
||||
echo "arduino-libraries/SD" >> depend.list
|
||||
echo "frankjoshua/rosserial_arduino_lib" >> depend.list
|
||||
|
||||
|
||||
- name: Create a ignore.list file
|
||||
run: |
|
||||
# eg: echo "<path>,<fqbn>" >> ignore.list
|
||||
|
||||
# ROS library has some issue with std_msg, so we ignore them,waiting for the fix
|
||||
|
||||
echo "send_Blink_ROS,Seeeduino:samd:seeed_XIAO_m0" >> ignore.list
|
||||
echo "send_Blink_ROS,Seeeduino:nrf52:xiaonRF52840" >> ignore.list
|
||||
echo "send_Blink_ROS,Seeeduino:nrf52:xiaonRF52840Sense" >> ignore.list
|
||||
echo "send_Blink_ROS,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
|
||||
echo "send_Blink_ROS,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
|
||||
echo "send_Blink_ROS,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
|
||||
echo "send_Blink_ROS,esp32:esp32:XIAO_ESP32C3" >> ignore.list
|
||||
echo "send_Blink_ROS,esp32:esp32:XIAO_ESP32C6" >> ignore.list
|
||||
echo "send_Blink_ROS,esp32:esp32:XIAO_ESP32S3" >> ignore.list
|
||||
|
||||
echo "receive_sleep,Seeeduino:samd:seeed_XIAO_m0" >> ignore.list
|
||||
echo "receive_sleep,Seeeduino:nrf52:xiaonRF52840" >> ignore.list
|
||||
echo "receive_sleep,Seeeduino:nrf52:xiaonRF52840Sense" >> ignore.list
|
||||
echo "receive_sleep,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
|
||||
echo "receive_sleep,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
|
||||
echo "receive_sleep,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
|
||||
echo "receive_sleep,esp32:esp32:XIAO_ESP32C3" >> ignore.list
|
||||
echo "receive_sleep,esp32:esp32:XIAO_ESP32C6" >> ignore.list
|
||||
echo "receive_sleep,esp32:esp32:XIAO_ESP32S3" >> ignore.list
|
||||
|
||||
|
||||
echo "send_sleep,Seeeduino:samd:seeed_XIAO_m0" >> ignore.list
|
||||
echo "send_sleep,Seeeduino:nrf52:xiaonRF52840" >> ignore.list
|
||||
echo "send_sleep,Seeeduino:nrf52:xiaonRF52840Sense" >> ignore.list
|
||||
echo "send_sleep,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
|
||||
echo "send_sleep,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
|
||||
echo "send_sleep,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
|
||||
echo "send_sleep,esp32:esp32:XIAO_ESP32C3" >> ignore.list
|
||||
echo "send_sleep,esp32:esp32:XIAO_ESP32C6" >> ignore.list
|
||||
echo "send_sleep,esp32:esp32:XIAO_ESP32S3" >> ignore.list
|
||||
|
||||
|
||||
|
||||
- name: Build sketch
|
||||
run: ./ci/tools/compile.sh
|
||||
|
||||
- name: Build result
|
||||
run: |
|
||||
cat build.log
|
||||
if [ ${{ github.event_name }} == 'pull_request' ] && [ -f compile.failed ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Generate issue
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
run: ./ci/tools/issue.sh
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -48,7 +48,13 @@ void setup() {
|
||||
}
|
||||
SERIAL_PORT_MONITOR.println("CAN init ok!");
|
||||
byte mode = CAN.getMode();
|
||||
#ifdef ARDUINO_XIAO_RA4M1
|
||||
char buffer[50];
|
||||
sprintf(buffer, "CAN BUS mode = %d\n\r", mode);
|
||||
SERIAL_PORT_MONITOR.print(buffer);
|
||||
#else
|
||||
SERIAL_PORT_MONITOR.printf("CAN BUS mode = %d\n\r", mode);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MCP2515_ISR() {
|
||||
|
||||
@@ -5,6 +5,19 @@
|
||||
#include <SPI.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifndef SERIAL_PORT_MONITOR
|
||||
|
||||
#ifdef SEEED_XIAO_M0
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
#elif defined(ARDUINO_SAMD_VARIANT_COMPLIANCE)
|
||||
#define SERIAL_PORT_MONITOR SerialUSB
|
||||
#else
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define CAN_OK (0)
|
||||
#define CAN_FAILINIT (1)
|
||||
#define CAN_FAILTX (2)
|
||||
|
||||
Reference in New Issue
Block a user