Skip to content

Commit 755ce20

Browse files
Fix 180 LED issue with SRGBMods Pi Pico controller
1 parent a7c2b7b commit 755ce20

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Controllers/SRGBmodsController/SRGBmodsPicoController.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ std::string SRGBmodsPicoController::GetSerialString()
7171

7272
void SRGBmodsPicoController::SetChannelLEDs(unsigned char channel, RGBColor* colors, unsigned int num_colors)
7373
{
74-
unsigned int num_packets = num_colors / 20 + ((num_colors % 20) > 0);
74+
unsigned int num_packets = (num_colors / 20) + ((num_colors % 20) > 0);
7575
unsigned int color_idx = 0;
7676

7777
for(unsigned int packet_idx = 0; packet_idx < num_packets; packet_idx++)
@@ -83,7 +83,7 @@ void SRGBmodsPicoController::SetChannelLEDs(unsigned char channel, RGBColor* col
8383
colors_in_packet = num_colors - color_idx;
8484
}
8585

86-
SendPacket(channel, packet_idx + 1, num_packets, false, &colors[color_idx * 3], colors_in_packet);
86+
SendPacket(channel, packet_idx + 1, num_packets, false, &colors[color_idx], colors_in_packet);
8787

8888
color_idx += colors_in_packet;
8989
}
@@ -131,4 +131,4 @@ void SRGBmodsPicoController::SendPacket
131131
| Send packet |
132132
\*-----------------------------------------------------*/
133133
hid_write(dev, usb_buf, 65);
134-
}
134+
}

0 commit comments

Comments
 (0)