FastLED 3.9.15
Loading...
Searching...
No Matches

◆ sub8()

LIB8STATIC_ALWAYS_INLINE uint8_t sub8 ( uint8_t i,
uint8_t j )

Subtract one byte from another, 8-bit result.

Note
This does not saturate and may overflow!
Parameters
ibyte to subtract from
jbyte to subtract
Returns
i - j

Definition at line 174 of file math8.h.

174 {
175#if SUB8_C == 1
176 int t = i - j;
177 return t;
178#elif SUB8_AVRASM == 1
179 // Subtract j from i, period.
180 asm volatile("sub %0, %1" : "+r"(i) : "r"(j));
181 return i;
182#else
183#error "No implementation for sub8 available."
184#endif
185}

References LIB8STATIC_ALWAYS_INLINE.