Akemi bugfix for panel width > 32

due to a math accident, Akemi did not show proper GEQ bands in its hands when width>32.
This commit is contained in:
Frank
2024-09-30 17:33:25 +02:00
committed by GitHub
parent 63ff7205d6
commit 813b3705c1

View File

@@ -7998,11 +7998,12 @@ uint16_t mode_2DAkemi(void) {
//add geq left and right
if (um_data) {
for (int x=0; x < cols/8; x++) {
uint16_t band = x * cols/8;
int xMax = cols/8;
for (int x=0; x < xMax; x++) {
size_t band = map2(x, 0, max(xMax,4), 0, 15); // map 0..cols/8 to 16 GEQ bands
CRGB color = SEGMENT.color_from_palette((band * 35), false, PALETTE_SOLID_WRAP, 0);
band = constrain(band, 0, 15);
uint16_t barHeight = map(fftResult[band], 0, 255, 0, 17*rows/32);
CRGB color = SEGMENT.color_from_palette((band * 35), false, PALETTE_SOLID_WRAP, 0);
for (int y=0; y < barHeight; y++) {
SEGMENT.setPixelColorXY(x, rows/2-y, color);