Linear interpolation between two signed 15-bit values, with 8-bit fraction.
Definition at line 488 of file lib8tion.h.
489{
490 int16_t result;
491 if( b > a) {
492 uint16_t delta = b - a;
494 result = a + scaled;
495 } else {
496 uint16_t delta = a - b;
498 result = a - scaled;
499 }
500 return result;
501}
LIB8STATIC_ALWAYS_INLINE uint16_t scale16by8(uint16_t i, fract8 scale)
Scale a 16-bit unsigned value by an 8-bit value, which is treated as the numerator of a fraction whos...
References LIB8STATIC, and scale16by8().