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

Method injectTestValue

src/fl/sensors/potentiometer.h:124–135  ·  view source on GitHub ↗

Inject a test value directly (bypasses analogRead) Only available in unit test builds

Source from the content-addressed store, hash-verified

122 // Inject a test value directly (bypasses analogRead)
123 // Only available in unit test builds
124 void injectTestValue(u16 value) {
125 mCurrentValue = value;
126 // Manually trigger change detection logic
127 u16 diff = (value > mLastValue) ? (value - mLastValue) : (mLastValue - value);
128 mChangedThisFrame = (diff >= mHysteresis);
129 if (mChangedThisFrame) {
130 mLastValue = value;
131 mOnChangeCallbacks.invoke(*this);
132 float normalized_value = normalized();
133 mOnChangeNormalizedCallbacks.invoke(normalized_value);
134 }
135 }
136#endif
137
138 protected:

Callers 1

FL_TEST_FILEFunction · 0.80

Calls 1

invokeMethod · 0.45

Tested by

no test coverage detected