Skip to content

Commit 7115cad

Browse files
committed
Fix build failures on non-SAM E boards
1 parent a5b3912 commit 7115cad

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/CAN.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
#ifndef CAN_H
55
#define CAN_H
66

7-
#ifdef ARDUINO_ARCH_ESP32
7+
#if defined(ADAFRUIT_FEATHER_M4_CAN)
8+
#include "CANSAME5x.h"
9+
#elif defined(ARDUINO_ARCH_ESP32)
810
#include "ESP32SJA1000.h"
911
#else
1012
#include "MCP2515.h"

src/CANSAME5x.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright 2020 © Jeff Epler for Adafruit Industries. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
#if defined(ADAFRUIT_FEATHER_M4_CAN)
45
#include <stdint.h>
56
#include <stdlib.h>
67

@@ -501,3 +502,7 @@ void CAN1_Handler() {
501502
}
502503

503504
CANSAME5x *CANSAME5x::instances[2];
505+
506+
CANSAME5x CAN;
507+
508+
#endif

src/CANSAME5x.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ class CANSAME5x : public CANControllerClass {
5050
friend void CAN0_Handler(void);
5151
friend void CAN1_Handler(void);
5252
};
53+
54+
extern CANSAME5x CAN;

0 commit comments

Comments
 (0)