Skip to content

Commit 6f91910

Browse files
committed
Added SAMD51 support
1 parent 829d8eb commit 6f91910

File tree

26 files changed

+114
-59
lines changed

26 files changed

+114
-59
lines changed

.github/workflows/LibraryBuild.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
- arduino:avr:leonardo
5656
- arduino:megaavr:nona4809:mode=off
5757
- arduino:samd:arduino_zero_native
58+
- adafruit:samd:adafruit_metro_m4:cache=on,speed=120,opt=small,maxqspi=50,usbstack=arduino,debug=off
5859
- arduino:mbed:nano33ble
5960
- arduino:mbed_rp2040:pico
6061
- rp2040:rp2040:arduino_nano_connect
@@ -125,6 +126,10 @@ jobs:
125126
build-properties: # the flags were put in compiler.cpp.extra_flags
126127
IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=100
127128

129+
- arduino-boards-fqbn: adafruit:samd:adafruit_metro_m4:cache=on,speed=120,opt=small,maxqspi=50,usbstack=arduino,debug=off
130+
platform-url: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
131+
sketches-exclude: MinimalReceiver,IRDispatcherDemo
132+
128133
- arduino-boards-fqbn: arduino:mbed:nano33ble
129134
build-properties: # the flags were put in compiler.cpp.extra_flags
130135
IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=100

examples/AllProtocols/AllProtocols.ino

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@
6868
#define DEBUG_BUTTON_PIN 6
6969
#endif
7070

71-
// On the Zero and others we switch explicitly to SerialUSB
72-
#if defined(ARDUINO_ARCH_SAMD)
73-
#define Serial SerialUSB
74-
#endif
75-
7671
/*
7772
* Activate the type of LCD you use
7873
* Default is serial LCD with 2 rows of 16 characters (1602).

examples/AllProtocols/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ void noTone(uint8_t aPinNumber){
234234
#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
235235
#define _IR_TIMING_TEST_PIN 7
236236

237+
#if !defined(ARDUINO_SAMD_ADAFRUIT)
237238
// On the Zero and others we switch explicitly to SerialUSB
238239
#define Serial SerialUSB
240+
#endif
239241

240242
// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
241243
// Attention!!! D2 and D4 are swapped on these boards!!!

examples/ControlRelay/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ void noTone(uint8_t aPinNumber){
234234
#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
235235
#define _IR_TIMING_TEST_PIN 7
236236

237+
#if !defined(ARDUINO_SAMD_ADAFRUIT)
237238
// On the Zero and others we switch explicitly to SerialUSB
238239
#define Serial SerialUSB
240+
#endif
239241

240242
// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
241243
// Attention!!! D2 and D4 are swapped on these boards!!!

examples/IRDispatcherDemo/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ void noTone(uint8_t aPinNumber){
234234
#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
235235
#define _IR_TIMING_TEST_PIN 7
236236

237+
#if !defined(ARDUINO_SAMD_ADAFRUIT)
237238
// On the Zero and others we switch explicitly to SerialUSB
238239
#define Serial SerialUSB
240+
#endif
239241

240242
// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
241243
// Attention!!! D2 and D4 are swapped on these boards!!!

examples/IRremoteExtensionTest/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ void noTone(uint8_t aPinNumber){
234234
#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
235235
#define _IR_TIMING_TEST_PIN 7
236236

237+
#if !defined(ARDUINO_SAMD_ADAFRUIT)
237238
// On the Zero and others we switch explicitly to SerialUSB
238239
#define Serial SerialUSB
240+
#endif
239241

240242
// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
241243
// Attention!!! D2 and D4 are swapped on these boards!!!

examples/MicroGirs/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ void noTone(uint8_t aPinNumber){
234234
#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
235235
#define _IR_TIMING_TEST_PIN 7
236236

237+
#if !defined(ARDUINO_SAMD_ADAFRUIT)
237238
// On the Zero and others we switch explicitly to SerialUSB
238239
#define Serial SerialUSB
240+
#endif
239241

240242
// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
241243
// Attention!!! D2 and D4 are swapped on these boards!!!

examples/ReceiveAndSend/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ void noTone(uint8_t aPinNumber){
234234
#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
235235
#define _IR_TIMING_TEST_PIN 7
236236

237+
#if !defined(ARDUINO_SAMD_ADAFRUIT)
237238
// On the Zero and others we switch explicitly to SerialUSB
238239
#define Serial SerialUSB
240+
#endif
239241

240242
// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
241243
// Attention!!! D2 and D4 are swapped on these boards!!!

examples/ReceiveAndSend/ReceiveAndSend.ino

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ int STATUS_PIN = LED_BUILTIN;
5555
int DELAY_BETWEEN_REPEAT = 50;
5656
int DEFAULT_NUMBER_OF_REPEATS_TO_SEND = 3;
5757

58-
// On the Zero and others we switch explicitly to SerialUSB
59-
#if defined(ARDUINO_ARCH_SAMD)
60-
#define Serial SerialUSB
61-
#endif
62-
6358
// Storage for the recorded code
6459
struct storedIRDataStruct {
6560
IRData receivedIRData;

examples/ReceiveDemo/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ void noTone(uint8_t aPinNumber){
234234
#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
235235
#define _IR_TIMING_TEST_PIN 7
236236

237+
#if !defined(ARDUINO_SAMD_ADAFRUIT)
237238
// On the Zero and others we switch explicitly to SerialUSB
238239
#define Serial SerialUSB
240+
#endif
239241

240242
// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
241243
// Attention!!! D2 and D4 are swapped on these boards!!!

0 commit comments

Comments
 (0)