From 9ed017304b0f469107e0798f64b1acde4ad883da Mon Sep 17 00:00:00 2001 From: driverblock Date: Sun, 3 Sep 2017 13:51:28 -0400 Subject: [PATCH] Support Arduino Due Will now compile for Arduino Due target --- Adafruit_TLC59711.cpp | 8 ++++++-- library.properties | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Adafruit_TLC59711.cpp b/Adafruit_TLC59711.cpp index 3763415..2ef2ea2 100644 --- a/Adafruit_TLC59711.cpp +++ b/Adafruit_TLC59711.cpp @@ -35,7 +35,11 @@ Adafruit_TLC59711::Adafruit_TLC59711(uint8_t n) { _dat = -1; SPI.setBitOrder(MSBFIRST); +#ifdef __arm__ + SPI.setClockDivider(42); +#else SPI.setClockDivider(SPI_CLOCK_DIV8); +#endif SPI.setDataMode(SPI_MODE0); BCr = BCg = BCb = 0x7F; @@ -79,7 +83,7 @@ void Adafruit_TLC59711::write(void) { command <<= 7; command |= BCb; - cli(); + noInterrupts(); for (uint8_t n=0; n> 24); spiwriteMSB(command >> 16); @@ -98,7 +102,7 @@ void Adafruit_TLC59711::write(void) { delayMicroseconds(200); else delayMicroseconds(2); - sei(); + interrupts(); } diff --git a/library.properties b/library.properties index 2b56b27..3e6d16b 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Adafruit TLC59711 -version=1.0.0 +version=1.0.1 author=Adafruit maintainer=Adafruit sentence=Library for our Adafruit 12-channel PWM/LED driver.