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

◆ update()

template<typename T>
T fl::detail::AttackDecayFilterImpl< T >::update ( T input,
T dt_seconds )
inline

Definition at line 14 of file attack_decay_filter_impl.h.

14 {
15 T abs_input = (input < T(0)) ? -input : input;
16 T abs_y = (mY < T(0)) ? -mY : mY;
18 if (tau <= T(0)) {
19 mY = input; // No smoothing when tau <= 0
20 return mY;
21 }
23 mY = input + (mY - input) * decay;
24 return mY;
25 }
enable_if< is_fixed_point< T >::value, T >::type exp(T x) FL_NOEXCEPT

References fl::exp(), mAttackTau, mDecayTau, and mY.

+ Here is the call graph for this function: