Skip to content

Commit

Permalink
fix: Fix compilation errors on some boards
Browse files Browse the repository at this point in the history
  • Loading branch information
ackPeng committed Dec 26, 2024
1 parent 1a93c67 commit 3ecdf0d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 37 deletions.
40 changes: 3 additions & 37 deletions .github/workflows/run-cl-arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,48 +27,14 @@ jobs:
- name: Create a depend.list file
run: |
# eg: echo "<repo>" >> depend.list
echo "TheNitek/NDEF" >> depend.list
echo "miguelbalboa/rfid" >> depend.list
echo "OSSLibraries/Arduino_MFRC522v2" >> depend.list
echo "don/NDEF" >> depend.list
- name: Create a ignore.list file
run: |
# eg: echo "<path>,<fqbn>" >> ignore.list
echo "FeliCa_card_detection,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
echo "FeliCa_card_read,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
echo "p2p_raw,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
echo "p2p_with_ndef_library,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
echo "FeliCa_card_detection,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
echo "FeliCa_card_read,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
echo "emulate_tag_ndef,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
echo "ntag21x_protect,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
echo "ntag21x_rw,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
echo "p2p_raw,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
echo "p2p_with_ndef_library,rp2040:rp2040:seeed_xiao_rp2040" >> ignore.list
echo "FeliCa_card_detection,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
echo "FeliCa_card_read,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
echo "emulate_tag_ndef,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
echo "ntag21x_protect,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
echo "ntag21x_rw,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
echo "p2p_raw,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
echo "p2p_with_ndef_library,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
echo "emulate_tag_ndef,esp32:esp32:XIAO_ESP32C3" >> ignore.list
echo "ntag21x_protect,esp32:esp32:XIAO_ESP32C3" >> ignore.list
echo "ntag21x_rw,esp32:esp32:XIAO_ESP32C3" >> ignore.list
echo "p2p_with_ndef_library,esp32:esp32:XIAO_ESP32C3" >> ignore.list
echo "emulate_tag_ndef,esp32:esp32:XIAO_ESP32C6" >> ignore.list
echo "ntag21x_protect,esp32:esp32:XIAO_ESP32C6seeed_xiao_rp2350" >> ignore.list
echo "ntag21x_rw,esp32:esp32:XIAO_ESP32C6" >> ignore.list
echo "p2p_with_ndef_library,esp32:esp32:XIAO_ESP32C6" >> ignore.list
echo "emulate_tag_ndef,esp32:esp32:XIAO_ESP32S3" >> ignore.list
echo "ntag21x_protect,esp32:esp32:XIAO_ESP32S33" >> ignore.list
echo "ntag21x_rw,esp32:esp32:XIAO_ESP32S3" >> ignore.list
echo "p2p_with_ndef_library,esp32:esp32:XIAO_ESP32S3" >> ignore.list
- name: Build sketch
Expand Down
6 changes: 6 additions & 0 deletions examples/emulate_tag_ndef/emulate_tag_ndef.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#include "emulatetag.h"
#include "NdefMessage.h"

#ifdef NRF52840_XXAA
#ifdef USE_TINYUSB
#include <Adafruit_TinyUSB.h>
#endif
#endif

#if 0
#define NFC_INTERFACE_SPI
#include <SPI.h>
Expand Down
3 changes: 3 additions & 0 deletions src/PN532_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ void PN532_SPI::begin()
pinMode(_ss, OUTPUT);

_spi->begin();
#if defined(ARDUINO_XIAO_RA4M1) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_RP2350)
#else
_spi->setDataMode(SPI_MODE0); // PN532 only supports mode0
_spi->setBitOrder(LSBFIRST);
#if defined __SAM3X8E__
Expand All @@ -31,6 +33,7 @@ void PN532_SPI::begin()
#else
_spi->setClockDivider(SPI_CLOCK_DIV8); // set clock 2MHz(max: 5MHz)
#endif
#endif
}

void PN532_SPI::wakeup()
Expand Down

0 comments on commit 3ecdf0d

Please sign in to comment.