Skip to content

Commit

Permalink
Support Arduino Due
Browse files Browse the repository at this point in the history
Will now compile for Arduino Due target
  • Loading branch information
driverblock committed Sep 3, 2017
1 parent 4e07892 commit 9ed0173
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Adafruit_TLC59711.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -79,7 +83,7 @@ void Adafruit_TLC59711::write(void) {
command <<= 7;
command |= BCb;

cli();
noInterrupts();
for (uint8_t n=0; n<numdrivers; n++) {
spiwriteMSB(command >> 24);
spiwriteMSB(command >> 16);
Expand All @@ -98,7 +102,7 @@ void Adafruit_TLC59711::write(void) {
delayMicroseconds(200);
else
delayMicroseconds(2);
sei();
interrupts();
}


Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit TLC59711
version=1.0.0
version=1.0.1
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Library for our Adafruit 12-channel PWM/LED driver.
Expand Down

0 comments on commit 9ed0173

Please sign in to comment.