diff options
-rw-r--r-- | clockless_trinket.h | 4 | ||||
-rw-r--r-- | led_sysdefs.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/clockless_trinket.h b/clockless_trinket.h index 64d6d354..f0637a70 100644 --- a/clockless_trinket.h +++ b/clockless_trinket.h @@ -15,6 +15,8 @@ #define DITHER 1 #endif +#define US_PER_TICK (64 / (F_CPU/1000000)) + // Variations on the functions in delay.h - w/a loop var passed in to preserve registers across calls by the optimizer/compiler template<int CYCLES> inline void _dc(register uint8_t & loopvar); @@ -255,7 +257,7 @@ protected: ADJDITHER2(d2,e2); cli(); - if((TCNT0-lasttime) > (F_CPU/2000000)) { sei(); return; } + if((TCNT0-lasttime) > ((WAIT_TIME-10)/US_PER_TICK)) { sei(); return; } // Sum of the clock counts across each row should be 10 for 8Mhz, WS2811 // The values in the D1/D2/D3 indicate how many cycles the previous column takes // to allow things to line back up. diff --git a/led_sysdefs.h b/led_sysdefs.h index 93a78071..fa40a46a 100644 --- a/led_sysdefs.h +++ b/led_sysdefs.h @@ -12,6 +12,7 @@ #define FASTLED_ARM #else #define FASTLED_AVR +#define FASTLED_ACCURATE_CLOCK #endif #ifndef CLK_DBL |