Skip to content

Commit a21e561

Browse files
committed
Fix compile errors USE_FAST_PINIO + compile on Robotis boards
There were a couple of compile issus when you are trying to use a different board which requires you not to use fast pinio. In particular Robotis OpenCM9.04 as well as the OpenCR 1.0 boards. They are STM32 based __arm__ boards but do not have the support for setting/clearing IO pins using memory mapped access to one location. First thing I ran into was the code in the #else casue was using #undefine which is not valid, should be #undef Second issue is once this define was undefined, the #defines for SPI_CS_HIGH and SPI_CS_LOW did not compile as there was no ; at the end of the digitalWrite. Probably worked earlier until somone put this statement into a {} pair
1 parent 7be0b49 commit a21e561

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Adafruit_SPITFT.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
typedef volatile uint8_t RwReg;
1717
#elif defined(ARDUINO_STM32_FEATHER)
1818
typedef volatile uint32 RwReg;
19+
#elif defined(__OPENCR__) || defined (__OPENCM904__)
20+
#undef USE_FAST_PINIO
1921
#elif defined(ARDUINO_FEATHER52) || defined(__arm__)
2022
typedef volatile uint32_t RwReg;
2123
#elif defined(ESP32) || defined(ESP8266)
2224
typedef volatile uint32_t RwReg;
2325
#else
24-
#undefine USE_FAST_PINIO
26+
#undef USE_FAST_PINIO
2527
#endif
2628

2729
#include "Adafruit_SPITFT_Macros.h"

Adafruit_SPITFT_Macros.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#else
1414
#define SPI_DC_HIGH() digitalWrite(_dc, HIGH)
1515
#define SPI_DC_LOW() digitalWrite(_dc, LOW)
16-
#define SPI_CS_HIGH() { if(_cs >= 0) digitalWrite(_cs, HIGH) }
17-
#define SPI_CS_LOW() { if(_cs >= 0) digitalWrite(_cs, LOW) }
16+
#define SPI_CS_HIGH() { if(_cs >= 0) digitalWrite(_cs, HIGH); }
17+
#define SPI_CS_LOW() { if(_cs >= 0) digitalWrite(_cs, LOW); }
1818
#endif
1919

2020
/*

0 commit comments

Comments
 (0)