Linear interpolation between two signed 15-bit values, with 8-bit fraction.
Definition at line 344 of file lib8tion.h.
345{
346 int16_t result;
347 if( b > a) {
348 uint16_t delta = b - a;
350 result = a + scaled;
351 } else {
352 uint16_t delta = a - b;
354 result = a - scaled;
355 }
356 return result;
357}
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().