diff options
Diffstat (limited to 'clockless_trinket.h')
-rw-r--r-- | clockless_trinket.h | 4 |
1 files changed, 3 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. |