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

Function countLitLeds

tests/fl/fx/1d/perlin_particle_punch.cpp:14–21  ·  view source on GitHub ↗

Helper: count non-black LEDs in the buffer

Source from the content-addressed store, hash-verified

12
13// Helper: count non-black LEDs in the buffer
14static int countLitLeds(const CRGB *leds, u16 count) {
15 int lit = 0;
16 for (u16 i = 0; i < count; ++i) {
17 if (leds[i].r > 0 || leds[i].g > 0 || leds[i].b > 0)
18 lit++;
19 }
20 return lit;
21}
22
23// Helper: check if any LEDs in a range are lit
24static bool anyLitInRange(const CRGB *leds, int start, int end, u16 count) {

Callers 1

FL_TEST_FILEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected