Skip to content

Commit 3b2bd33

Browse files
authored
Added a generic CAN include with default CAN construction as CAN and specific CAN construction for Teens with CAN_N (#44)
1 parent f885d39 commit 3b2bd33

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

include/CAN.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#pragma once
2+
3+
#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41)
4+
#include "teensy_can.h"
5+
// The bus number is a template argument for Teensy: TeensyCAN<bus_num>
6+
#define CAN TeensyCAN<1>
7+
#define CAN_N(bus_num) TeensyCAN<bus_num> // This allows you to choose a specific bus
8+
9+
#endif
10+
11+
#ifdef ARDUINO_ARCH_ESP32
12+
#include "esp_can.h"
13+
// The tx and rx pins are constructor arguments to ESPCan, which default to TX = 5, RX = 4
14+
#define CAN ESPCAN
15+
#endif

0 commit comments

Comments
 (0)