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

◆ getu8()

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

Definition at line 73 of file wave_simulation_real.h.

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

References geti16(), mHalfDuplex, and x.

+ Here is the call graph for this function: