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 183 of file math8.h.

183 {
184#if SUB8_C == 1
185 int t = i - j;
186 return static_cast<uint8_t>(t);
187#elif SUB8_AVRASM == 1
188 // Subtract j from i, period.
189 asm volatile("sub %0, %1" : "+r"(i) : "r"(j));
190 return i;
191#else
192#error "No implementation for sub8 available."
193#endif
194}
static uint32_t t
Definition Luminova.h:54

References LIB8STATIC_ALWAYS_INLINE, and t.