Skip to content

Commit 2bfe2cb

Browse files
committed
add support for LGT8F cpu
1 parent 14aa943 commit 2bfe2cb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Adafruit_SPITFT.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@
4040
#define AVR_WRITESPI(x) \
4141
for (SPI0_DATA = (x); (!(SPI0_INTFLAGS & _BV(SPI_IF_bp)));)
4242
#elif defined(__LGT8F__)
43-
#define AVR_WRITESPI(x) SPDR = (x);asm volatile("nop");while((SPFR & _BV(RDEMPT)));SPFR = _BV(RDEMPT) | _BV(WREMPT)
43+
#define AVR_WRITESPI(x) \
44+
SPDR = (x); \
45+
asm volatile("nop"); \
46+
while ((SPFR & _BV(RDEMPT))) \
47+
; \
48+
SPFR = _BV(RDEMPT) | _BV(WREMPT)
4449
#else
4550
#define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
4651
#endif

0 commit comments

Comments
 (0)