Skip to content

Commit 902ebc2

Browse files
Initialize transmit color count after inserting blanks
1 parent 403d60e commit 902ebc2

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Controllers/HyperXKeyboardController/HyperXAlloyOriginsController.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ HyperXAlloyOriginsController::~HyperXAlloyOriginsController()
2626

2727
void HyperXAlloyOriginsController::SetLEDsDirect(std::vector<RGBColor> colors)
2828
{
29-
int colors_to_send = colors.size();
30-
int colors_sent = 0;
31-
3229
/*-----------------------------------------------------*\
3330
| Insert color data for unused positions |
3431
\*-----------------------------------------------------*/
@@ -37,6 +34,13 @@ void HyperXAlloyOriginsController::SetLEDsDirect(std::vector<RGBColor> colors)
3734
colors.insert(colors.begin() + skip_idx[skip_cnt], 0x00000000);
3835
}
3936

37+
/*-----------------------------------------------------*\
38+
| Set up variables to track progress of color transmit |
39+
| Do this after inserting blanks |
40+
\*-----------------------------------------------------*/
41+
int colors_to_send = colors.size();
42+
int colors_sent = 0;
43+
4044
SendDirectInitialization();
4145

4246
for(int pkt_idx = 0; pkt_idx < 9; pkt_idx++)

0 commit comments

Comments
 (0)