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 624 of file lib8tion.h.

625{
626 uint8_t ii = scale8_LEAVING_R1_DIRTY( i, i);
627 uint8_t iii = scale8_LEAVING_R1_DIRTY( ii, i);
628
629 uint16_t r1 = (3 * (uint16_t)(ii)) - ( 2 * (uint16_t)(iii));
630
631 /* the code generated for the above *'s automatically
632 cleans up R1, so there's no need to explicitily call
633 cleanup_R1(); */
634
635 uint8_t result = r1;
636
637 // if we got "256", return 255:
638 if( r1 & 0x100 ) {
639 result = 255;
640 }
641 return result;
642}
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:176

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: