Merge pull request #313 from jayzakk/lgt8-support

add support for LGT8F cpu
This commit is contained in:
Jeff Epler authored and GitHub committed 2025-02-18 19:55:49 -06:00
commit 19ae104713
2 files changed
+8 -1

No files matched your search

+7
View File
@@ -40,6 +40,13 @@
#if defined(__AVR_XMEGA__) // only tested with __AVR_ATmega4809__
#define AVR_WRITESPI(x) \
for (SPI0_DATA = (x); (!(SPI0_INTFLAGS & _BV(SPI_IF_bp)));)
#elif defined(__LGT8F__)
#define AVR_WRITESPI(x) \
SPDR = (x); \
asm volatile("nop"); \
while ((SPFR & _BV(RDEMPT))) \
; \
SPFR = _BV(RDEMPT) | _BV(WREMPT)
#else
#define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
#endif