Helper: count non-black LEDs in the buffer
| 12 | |
| 13 | // Helper: count non-black LEDs in the buffer |
| 14 | static 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 |
| 24 | static bool anyLitInRange(const CRGB *leds, int start, int end, u16 count) { |