From 031e1c2d3112e068e9cf8900ade534dcd9d0b133 Mon Sep 17 00:00:00 2001 From: WereCatf Date: Mon, 23 Nov 2020 20:42:22 +0200 Subject: [PATCH] Make compatible with Heltec's CubeCell Arduino-core The functions fast pin-I/O uses are currently missing, so don't define BUSIO_USE_FAST_PINIO. Also, we need typedef for BitOrder, but it refuses to compile without also including Arduino.h, at least under PlatformIO. --- Adafruit_SPIDevice.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Adafruit_SPIDevice.h b/Adafruit_SPIDevice.h index 3d0c32d..77cd872 100644 --- a/Adafruit_SPIDevice.h +++ b/Adafruit_SPIDevice.h @@ -26,6 +26,14 @@ typedef enum _BitOrder { SPI_BITORDER_LSBFIRST = SPI_LSBFIRST, } BitOrder; +#elif defined(__ASR6501__) +#include +typedef enum _BitOrder +{ + SPI_BITORDER_MSBFIRST = MSBFIRST, + SPI_BITORDER_LSBFIRST = LSBFIRST, +} BitOrder; + #else // Some platforms have a BitOrder enum but its named MSBFIRST/LSBFIRST #define SPI_BITORDER_MSBFIRST MSBFIRST @@ -47,7 +55,9 @@ typedef uint32_t BusIO_PortMask; !defined(ARDUINO_ARCH_MBED) typedef volatile uint32_t BusIO_PortReg; typedef uint32_t BusIO_PortMask; +#if not defined(__ASR6501__) #define BUSIO_USE_FAST_PINIO +#endif #else #undef BUSIO_USE_FAST_PINIO