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

◆ getu8()

uint8_t fl::WaveSimulation1D_Real::getu8 ( size_t x) const
inline

Definition at line 71 of file wave_simulation_real.h.

71 {
72 int16_t value = geti16(x);
73 // Rebase the range from [-32768, 32767] to [0, 65535] then extract the
74 // upper 8 bits.
75 // return static_cast<uint8_t>(((static_cast<uint16_t>(value) + 32768))
76 // >>
77 // 8);
78 if (mHalfDuplex) {
79 uint16_t v2 = static_cast<uint16_t>(value);
80 v2 *= 2;
81 return static_cast<uint8_t>(v2 >> 8);
82 } else {
83 return static_cast<uint8_t>(
84 ((static_cast<uint16_t>(value) + 32768)) >> 8);
85 }
86 }
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
int16_t geti16(size_t x) const

References geti16(), mHalfDuplex, and x.

+ Here is the call graph for this function: