diff options
author | Daniel Garcia <dgarcia@dgarcia.net> | 2019-08-24 02:26:46 +0300 |
---|---|---|
committer | Daniel Garcia <dgarcia@dgarcia.net> | 2019-08-24 02:26:46 +0300 |
commit | 3c5484c336230f8346f2fd6ed8fb5a18ce835edc (patch) | |
tree | 8636f6a60c7f362a848635ea897418a4786d98a4 | |
parent | 24311f4fac7e3dfd28c34e134950d92dbbd103a4 (diff) |
FIx #870 -- make sure that the spi clock times, now that the template parameter is a 32-bit integer, do not wrap around to super huge numbers
-rw-r--r-- | fastspi_bitbang.h | 6 | ||||
-rw-r--r-- | release_notes.md | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/fastspi_bitbang.h b/fastspi_bitbang.h index 70795e8b..019b6dc0 100644 --- a/fastspi_bitbang.h +++ b/fastspi_bitbang.h @@ -118,10 +118,10 @@ public: #define CLOCK_HI_DELAY do { delayNanoseconds((DELAY_NS/4)); } while(0); #define CLOCK_LO_DELAY do { delayNanoseconds((DELAY_NS/4)); } while(0); #else - #define MIN_DELAY (NS(35) - 3) + #define MIN_DELAY ((NS(35)>3) ? (NS(35) - 3) : 1) - #define CLOCK_HI_DELAY do { delaycycles<MIN_DELAY>(); delaycycles<(((SPI_SPEED-6) / 2) - MIN_DELAY)>(); } while(0); - #define CLOCK_LO_DELAY do { delaycycles<(((SPI_SPEED-6) / 4))>(); } while(0); + #define CLOCK_HI_DELAY do { delaycycles<MIN_DELAY>(); delaycycles<((SPI_SPEED > 10) ? (((SPI_SPEED-6) / 2) - MIN_DELAY) : (SPI_SPEED))>(); } while(0); + #define CLOCK_LO_DELAY do { delaycycles<((SPI_SPEED > 10) ? ((SPI_SPEED-6) / 2) : (SPI_SPEED))>(); } while(0); #endif // write the BIT'th bit out via spi, setting the data pin then strobing the clcok diff --git a/release_notes.md b/release_notes.md index c18c95ca..158737c5 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,3 +1,8 @@ +FastLED 3.3.2pre +============= + +* Fix APA102 compile error #870 + FastLED 3.3.1 ============= |