MCPcopy Create free account
hub / github.com/FastLED/FastLED / isActive

Method isActive

src/fl/math/time_alpha.cpp.hpp:44–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 : mLatchMs(latchMs), mRisingTime(risingTime), mFallingTime(fallingTime) {}
43
44bool TimeRamp::isActive(u32 now) const FL_NOEXCEPT {
45
46 bool not_started = (mFinishedRisingTime == 0) &&
47 (mFinishedPlateauTime == 0) &&
48 (mFinishedFallingTime == 0);
49 if (not_started) {
50 // if we have not started, we are not active
51 return false;
52 }
53
54 if (now < mStart) {
55 // if the time is before the start, we are not active
56 return false;
57 }
58
59 if (now > mFinishedFallingTime) {
60 // if the time is after the finished rising, we are not active
61 return false;
62 }
63
64 return true;
65}
66
67RampPhase TimeRamp::getCurrentPhase(u32 now) const FL_NOEXCEPT {
68 if (!isActive(now)) {

Callers 2

detectMethod · 0.45
applyFancyEffectFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected