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

Function shiftUp

examples/Audio/simple/simple.h:158–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void shiftUp() {
159 // fade each led by 1%
160 if (fadeToBlack.as_int()) {
161
162 for (int i = 0; i < NUM_LEDS; ++i) {
163 auto &c = framebuffer[i];
164 c.fadeToBlackBy(fadeToBlack.as_int());
165 }
166 }
167
168 for (int y = HEIGHT - 1; y > 0; --y) {
169 fl::CRGB* row1 = &framebuffer[frameBufferXY(0, y)];
170 fl::CRGB* row2 = &framebuffer[frameBufferXY(0, y - 1)];
171 fl::memcopy(row1, row2, WIDTH * sizeof(fl::CRGB));
172 }
173 fl::CRGB* row = &framebuffer[frameBufferXY(0, 0)];
174 fl::memset(row, 0, sizeof(fl::CRGB) * WIDTH);
175}
176
177
178bool doFrame() {

Callers 1

loopFunction · 0.85

Calls 3

memcopyFunction · 0.85
memsetFunction · 0.85
as_intMethod · 0.45

Tested by

no test coverage detected