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

◆ add8()

LIB8STATIC_ALWAYS_INLINE uint8_t add8 ( uint8_t i,
uint8_t j )

Add one byte to another, with 8-bit result.

Note
This does not saturate and may overflow!
Parameters
ifirst byte to add
jsecond byte to add
Returns
the sum of i + j, 8-bit

Definition at line 135 of file math8.h.

135 {
136#if ADD8_C == 1
137 int t = i + j;
138 return t;
139#elif ADD8_AVRASM == 1
140 // Add j to i, period.
141 asm volatile("add %0, %1" : "+r"(i) : "r"(j));
142 return i;
143#else
144#error "No implementation for add8 available."
145#endif
146}

References LIB8STATIC_ALWAYS_INLINE.