diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2016-02-17 05:54:30 +0300 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2016-02-17 05:54:30 +0300 |
commit | f3cd261fd1bede82c4054e826e37223ffb5e2aa2 (patch) | |
tree | deeae88d59ec45579e8b461301a726f4bea5a16d | |
parent | bff4f1781656bd4e4e559fa2a4b90d7eae2103a8 (diff) |
Cleaning up some comments and ifdef guards
-rw-r--r-- | fastled_config.h | 6 | ||||
-rw-r--r-- | platforms/arm/common/m0clockless.h | 2 | ||||
-rw-r--r-- | platforms/avr/clockless_trinket.h | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/fastled_config.h b/fastled_config.h index 6624e0ad..08d20bcd 100644 --- a/fastled_config.h +++ b/fastled_config.h @@ -29,6 +29,12 @@ // #define FASTLED_NOISE_ALLOW_AVERAGE_TO_OVERFLOW 0 // #define FASTLED_NOISE_ALLOW_AVERAGE_TO_OVERFLOW 1 +// Use this toggle whether or not to use the 'fixed' FastLED scale8. The initial scale8 +// had a problem where scale8(255,255) would give you 254. This is now fixed, and that +// fix is enabled by default. However, if for some reason you have code that is not +// working right as a result of this (e.g. code that was expecting the old scale8 behavior) +// you can disable it here #define FASTLED_SCALE8_FIXED 1 +// define FASTLED_SCALE8_FIXED 0 #endif diff --git a/platforms/arm/common/m0clockless.h b/platforms/arm/common/m0clockless.h index 4cd6e150..cb174928 100644 --- a/platforms/arm/common/m0clockless.h +++ b/platforms/arm/common/m0clockless.h @@ -24,7 +24,7 @@ showLedData(volatile uint32_t *_port, uint32_t _bitmask, const uint8_t *_leds, u // high register variable register const uint8_t *leds = _leds; -#ifdef FASTLED_SCALE8_FIXED +#if (FASTLED_SCALE8_FIXED == 1) pData->s[0]++; pData->s[1]++; pData->s[2]++; diff --git a/platforms/avr/clockless_trinket.h b/platforms/avr/clockless_trinket.h index 8f56e9f2..e73841df 100644 --- a/platforms/avr/clockless_trinket.h +++ b/platforms/avr/clockless_trinket.h @@ -286,7 +286,7 @@ protected: #define MOV1(B1, B2) asm __volatile__(_MOV1 ASM_VARS ); // 3 cycle mov - skip if scale fix is happening -#ifdef FASTLED_SCALE8_FIXED +#if (FASTLED_SCALE8_FIXED == 1) #define _MOV_FIX03(B1, B2) "mov %[" #B1 "], %[scale_base]\n\tcpse %[s0], __zero_reg__\n\t" _MOV1(B1, B2) #define _MOV_FIX13(B1, B2) "mov %[" #B1 "], %[scale_base]\n\tcpse %[s1], __zero_reg__\n\t" _MOV1(B1, B2) #define _MOV_FIX23(B1, B2) "mov %[" #B1 "], %[scale_base]\n\tcpse %[s2], __zero_reg__\n\t" _MOV1(B1, B2) @@ -349,7 +349,7 @@ protected: uint8_t s0 = pixels.mScale.raw[RO(0)]; uint8_t s1 = pixels.mScale.raw[RO(1)]; uint8_t s2 = pixels.mScale.raw[RO(2)]; -#ifdef FASTLED_SCALE8_FIXED +#if (FASTLED_SCALE8_FIXED==1) s0++; s1++; s2++; #endif uint8_t d0 = pixels.d[RO(0)]; |