FastLED
3.9.15
Loading...
Searching...
No Matches
◆
half_duplex_blend_sqrt_q15()
uint8_t anonymous_namespace{wave_simulation.cpp}::half_duplex_blend_sqrt_q15
(
uint16_t
x
)
Definition at line
11
of file
wave_simulation.cpp
.
11
{
12
x
=
MIN
(
x
, 32767);
// Q15
13
const
int
Q = 15;
14
uint32_t X = (uint32_t)
x
<< Q;
// promote to Q30
15
uint32_t
y
= (1u << Q);
// start at β1.0β in Q15
16
17
// 3β4 iterations is plenty for 15βbit precision:
18
for
(
int
i = 0; i < 4; i++) {
19
y
= (
y
+ (X /
y
) ) >> 1;
20
}
21
return
static_cast<
int16_t
>
(
y
) >> 8;
22
}
x
uint32_t x[NUM_LAYERS]
Definition
Fire2023.ino:80
y
uint32_t y[NUM_LAYERS]
Definition
Fire2023.ino:81
MIN
#define MIN(a, b)
Definition
math_macros.h:8
References
MIN
,
x
, and
y
.
anonymous_namespace{wave_simulation.cpp}
Generated on Fri Apr 18 2025 03:39:32 for FastLED by
1.13.2