8-bit quadratic ease-in / ease-out function.
Takes around 13 cycles on AVR.
Definition at line 418 of file lib8tion.h.
419{
420 uint8_t j = i;
421 if( j & 0x80 ) {
422 j = 255 - j;
423 }
424 uint8_t jj =
scale8( j, j);
425 uint8_t jj2 = jj << 1;
426 if( i & 0x80 ) {
427 jj2 = 255 - jj2;
428 }
429 return jj2;
430}
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().