8-bit quadratic ease-in / ease-out function.
Takes around 13 cycles on AVR.
Definition at line 562 of file lib8tion.h.
563{
564 uint8_t j = i;
565 if( j & 0x80 ) {
566 j = 255 - j;
567 }
568 uint8_t jj =
scale8( j, j);
569 uint8_t jj2 = jj << 1;
570 if( i & 0x80 ) {
571 jj2 = 255 - jj2;
572 }
573 return jj2;
574}
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
References LIB8STATIC, and scale8().
Referenced by quadwave8().