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

Method setSegment

src/fl/control/wled/adapter.cpp.hpp:106–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void FastLEDAdapter::setSegment(size_t start, size_t end) {
107 CLEDController& controller = FastLED[mControllerIndex];
108 size_t numLeds = controller.size();
109
110 // Validate bounds
111 if (start >= numLeds) {
112 start = numLeds > 0 ? numLeds - 1 : 0;
113 }
114 if (end > numLeds) {
115 end = numLeds;
116 }
117 if (end <= start) {
118 end = start + 1;
119 if (end > numLeds) {
120 end = numLeds;
121 start = end > 0 ? end - 1 : 0;
122 }
123 }
124
125 mSegmentStart = start;
126 mSegmentEnd = end;
127 mHasSegment = true;
128}
129
130void FastLEDAdapter::clearSegment() {
131 CLEDController& controller = FastLED[mControllerIndex];

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected