FastLED 3.9.15
Loading...
Searching...
No Matches

◆ ease8InOutCubic()

LIB8STATIC fract8 ease8InOutCubic ( fract8 i)

8-bit cubic ease-in / ease-out function.

Takes around 18 cycles on AVR.

Definition at line 642 of file lib8tion.h.

643{
644 uint8_t ii = scale8_LEAVING_R1_DIRTY( i, i);
645 uint8_t iii = scale8_LEAVING_R1_DIRTY( ii, i);
646
647 uint16_t r1 = (3 * (uint16_t)(ii)) - ( 2 * (uint16_t)(iii));
648
649 /* the code generated for the above *'s automatically
650 cleans up R1, so there's no need to explicitily call
651 cleanup_R1(); */
652
653 uint8_t result = r1;
654
655 // if we got "256", return 255:
656 if( r1 & 0x100 ) {
657 result = 255;
658 }
659 return result;
660}
LIB8STATIC_ALWAYS_INLINE uint8_t scale8_LEAVING_R1_DIRTY(uint8_t i, fract8 scale)
This version of scale8() does not clean up the R1 register on AVR.
Definition scale8.h:170

References LIB8STATIC, and scale8_LEAVING_R1_DIRTY().

Referenced by cubicwave8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: