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.
This commit is contained in:
WereCatf 2020-11-23 20:42:22 +02:00 committed by GitHub
parent bbb893f51d
commit 031e1c2d31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -26,6 +26,14 @@ typedef enum _BitOrder {
SPI_BITORDER_LSBFIRST = SPI_LSBFIRST,
} BitOrder;
#elif defined(__ASR6501__)
#include <Arduino.h>
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