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

Method setSegment

tests/fl/fx/mock_fastled.h:135–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 void setSegment(size_t start, size_t end) override {
136 // Validate bounds
137 if (start >= mNumLeds) {
138 start = mNumLeds > 0 ? mNumLeds - 1 : 0;
139 }
140 if (end > mNumLeds) {
141 end = mNumLeds;
142 }
143 if (end <= start) {
144 end = start + 1;
145 if (end > mNumLeds) {
146 end = mNumLeds;
147 start = end > 0 ? end - 1 : 0;
148 }
149 }
150
151 mSegmentStart = start;
152 mSegmentEnd = end;
153 mHasSegment = true;
154 }
155
156 void clearSegment() override {
157 mSegmentStart = 0;

Callers 1

FL_TEST_FILEFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected