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

◆ selectBasedOnHashBit()

static int8_t selectBasedOnHashBit ( uint8_t hash,
uint8_t bitnumber,
int8_t a,
int8_t b )
inlinestatic

Definition at line 168 of file noise.cpp.

168 {
169 int8_t result;
170#if !defined(__AVR__)
171 result = (hash & (1<<bitnumber)) ? a : b;
172#else
173 asm volatile(
174 "mov %[result],%[a] \n\t"
175 "sbrs %[hash],%[bitnumber] \n\t"
176 "mov %[result],%[b] \n\t"
177 : [result] "=r" (result)
178 : [hash] "r" (hash),
179 [bitnumber] "M" (bitnumber),
180 [a] "r" (a),
181 [b] "r" (b)
182 );
183#endif
184 return result;
185}