Skip to content
Permalink
Browse files

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
  • Loading branch information...
Daniel Garcia
Daniel Garcia committed Aug 23, 2019
1 parent 24311f4 commit 3c5484c336230f8346f2fd6ed8fb5a18ce835edc
Showing with 8 additions and 3 deletions.
  1. +3 −3 fastspi_bitbang.h
  2. +5 −0 release_notes.md
@@ -118,10 +118,10 @@ class AVRSoftwareSPIOutput {
#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
@@ -1,3 +1,8 @@
FastLED 3.3.2pre
=============

* Fix APA102 compile error #870

FastLED 3.3.1
=============

0 comments on commit 3c5484c

Please sign in to comment.
You can’t perform that action at this time.