Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib8tion.h')
-rw-r--r--src/lib8tion.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/lib8tion.h b/src/lib8tion.h
index 80e27100..43dedbc0 100644
--- a/src/lib8tion.h
+++ b/src/lib8tion.h
@@ -33,7 +33,7 @@ FASTLED_NAMESPACE_BEGIN
qsub8( i, j) == MAX( (i - j), 0 )
- Saturating signed 8-bit ("7-bit") add.
- qadd7( i, j) == MIN( (i + j), 0x7F)
+ qadd7( i, j) == MAX( MIN( (i + j), 0x7F), -0x80)
- Scaling (down) of unsigned 8- and 16- bit values.
@@ -99,7 +99,7 @@ FASTLED_NAMESPACE_BEGIN
- Fast 8-bit "easing in/out" function.
- ease8InOutCubic(x) == 3(x^i) - 2(x^3)
+ ease8InOutCubic(x) == 3(x^2) - 2(x^3)
ease8InOutApprox(x) ==
faster, rougher, approximation of cubic easing
ease8InOutQuad(x) == quadratic (vs cubic) easing
@@ -208,8 +208,10 @@ Lib8tion is pronounced like 'libation': lie-BAY-shun
#define SUB8_C 1
#define EASE8_C 1
#define AVG8_C 1
+#define AVG8R_C 1
#define AVG7_C 1
#define AVG16_C 1
+#define AVG16R_C 1
#define AVG15_C 1
#define BLEND8_C 1
@@ -231,8 +233,10 @@ Lib8tion is pronounced like 'libation': lie-BAY-shun
#define SUB8_C 1
#define EASE8_C 1
#define AVG8_C 1
+#define AVG8R_C 1
#define AVG7_C 1
#define AVG16_C 1
+#define AVG16R_C 1
#define AVG15_C 1
#define BLEND8_C 1
@@ -249,8 +253,10 @@ Lib8tion is pronounced like 'libation': lie-BAY-shun
#define ADD8_C 0
#define SUB8_C 0
#define AVG8_C 0
+#define AVG8R_C 0
#define AVG7_C 0
#define AVG16_C 0
+#define AVG16R_C 0
#define AVG15_C 0
#define QADD8_AVRASM 1
@@ -260,8 +266,10 @@ Lib8tion is pronounced like 'libation': lie-BAY-shun
#define ADD8_AVRASM 1
#define SUB8_AVRASM 1
#define AVG8_AVRASM 1
+#define AVG8R_AVRASM 1
#define AVG7_AVRASM 1
#define AVG16_AVRASM 1
+#define AVG16R_AVRASM 1
#define AVG15_AVRASM 1
// Note: these require hardware MUL instruction
@@ -319,8 +327,10 @@ Lib8tion is pronounced like 'libation': lie-BAY-shun
#define SUB8_C 1
#define EASE8_C 1
#define AVG8_C 1
+#define AVG8R_C 1
#define AVG7_C 1
#define AVG16_C 1
+#define AVG16R_C 1
#define AVG15_C 1
#define BLEND8_C 1
@@ -732,9 +742,9 @@ LIB8STATIC uint8_t ease8InOutApprox( fract8 i)
"Ldone_%=: \n\t"
- : [i] "+&a" (i)
+ : [i] "+a" (i)
:
- : "r0", "r1"
+ : "r0"
);
return i;
}
@@ -744,7 +754,7 @@ LIB8STATIC uint8_t ease8InOutApprox( fract8 i)
-/// triwave8: triangle (sawtooth) wave generator. Useful for
+/// triwave8: triangle wave generator. Useful for
/// turning a one-byte ever-increasing value into a
/// one-byte value that oscillates up and down.
///