Skip to content

Commit 16789ef

Browse files
Alloy FPS: Don't send extended packet, increase time between packets to 10ms to eliminate flickering
1 parent c522609 commit 16789ef

File tree

2 files changed

+4
-84
lines changed

2 files changed

+4
-84
lines changed

Controllers/HyperXKeyboardController/HyperXAlloyFPSController.cpp

+3-71
Original file line numberDiff line numberDiff line change
@@ -139,28 +139,21 @@ void HyperXAlloyFPSController::SetLEDsDirect(std::vector<RGBColor> colors)
139139
red_color_data
140140
);
141141

142-
std::this_thread::sleep_for(5ms);
142+
std::this_thread::sleep_for(10ms);
143143

144144
SendDirect
145145
(
146146
HYPERX_ALLOY_FPS_COLOR_CHANNEL_GREEN,
147147
grn_color_data
148148
);
149149

150-
std::this_thread::sleep_for(5ms);
150+
std::this_thread::sleep_for(10ms);
151151

152152
SendDirect
153153
(
154154
HYPERX_ALLOY_FPS_COLOR_CHANNEL_BLUE,
155155
blu_color_data
156156
);
157-
158-
std::this_thread::sleep_for(5ms);
159-
160-
SendDirectExtended
161-
(
162-
ext_color_data
163-
);
164157
}
165158

166159
void HyperXAlloyFPSController::SetLEDs(std::vector<RGBColor> colors)
@@ -201,14 +194,6 @@ void HyperXAlloyFPSController::SetLEDs(std::vector<RGBColor> colors)
201194
HYPERX_ALLOY_FPS_COLOR_CHANNEL_BLUE,
202195
blu_color_data
203196
);
204-
205-
std::this_thread::sleep_for(5ms);
206-
207-
SendExtendedColor
208-
(
209-
0x01,
210-
ext_color_data
211-
);
212197
}
213198

214199
/*-------------------------------------------------------------------------------------------------*\
@@ -381,33 +366,6 @@ void HyperXAlloyFPSController::SendColor
381366
hid_send_feature_report(dev, buf, 264);
382367
}
383368

384-
void HyperXAlloyFPSController::SendExtendedColor
385-
(
386-
unsigned char profile,
387-
unsigned char* color_data
388-
)
389-
{
390-
unsigned char buf[264];
391-
392-
/*-----------------------------------------------------*\
393-
| Zero out buffer |
394-
\*-----------------------------------------------------*/
395-
memset(buf, 0x00, sizeof(buf));
396-
397-
/*-----------------------------------------------------*\
398-
| Set up Color packet |
399-
\*-----------------------------------------------------*/
400-
buf[0x00] = 0x07;
401-
buf[0x01] = HYPERX_ALLOY_FPS_PACKET_ID_SET_COLOR;
402-
buf[0x02] = profile;
403-
buf[0x03] = HYPERX_ALLOY_FPS_COLOR_CHANNEL_EXTENDED;
404-
405-
/*-----------------------------------------------------*\
406-
| Send packet |
407-
\*-----------------------------------------------------*/
408-
hid_send_feature_report(dev, buf, 264);
409-
}
410-
411369
void HyperXAlloyFPSController::SendDirect
412370
(
413371
unsigned char color_channel,
@@ -441,30 +399,4 @@ void HyperXAlloyFPSController::SendDirect
441399
| Send packet |
442400
\*-----------------------------------------------------*/
443401
hid_send_feature_report(dev, buf, 264);
444-
}
445-
446-
void HyperXAlloyFPSController::SendDirectExtended
447-
(
448-
unsigned char* color_data
449-
)
450-
{
451-
unsigned char buf[264];
452-
453-
/*-----------------------------------------------------*\
454-
| Zero out buffer |
455-
\*-----------------------------------------------------*/
456-
memset(buf, 0x00, sizeof(buf));
457-
458-
/*-----------------------------------------------------*\
459-
| Set up Direct packet |
460-
\*-----------------------------------------------------*/
461-
buf[0x00] = 0x07;
462-
buf[0x01] = HYPERX_ALLOY_FPS_PACKET_ID_DIRECT;
463-
buf[0x02] = HYPERX_ALLOY_FPS_COLOR_CHANNEL_EXTENDED;
464-
buf[0x03] = 0xA0;
465-
466-
/*-----------------------------------------------------*\
467-
| Send packet |
468-
\*-----------------------------------------------------*/
469-
hid_send_feature_report(dev, buf, 264);
470-
}
402+
}

Controllers/HyperXKeyboardController/HyperXAlloyFPSController.h

+1-13
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ enum
5858
{
5959
HYPERX_ALLOY_FPS_COLOR_CHANNEL_RED = 0x01,
6060
HYPERX_ALLOY_FPS_COLOR_CHANNEL_GREEN = 0x02,
61-
HYPERX_ALLOY_FPS_COLOR_CHANNEL_BLUE = 0x03,
62-
HYPERX_ALLOY_FPS_COLOR_CHANNEL_EXTENDED = 0x04
61+
HYPERX_ALLOY_FPS_COLOR_CHANNEL_BLUE = 0x03
6362
};
6463

6564
class HyperXAlloyFPSController
@@ -120,20 +119,9 @@ class HyperXAlloyFPSController
120119
unsigned char* color_data
121120
);
122121

123-
void SendExtendedColor
124-
(
125-
unsigned char profile,
126-
unsigned char* color_data
127-
);
128-
129122
void SendDirect
130123
(
131124
unsigned char color_channel,
132125
unsigned char* color_data
133126
);
134-
135-
void SendDirectExtended
136-
(
137-
unsigned char* color_data
138-
);
139127
};

0 commit comments

Comments
 (0)