mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-10-20 23:54:58 -04:00
Update RGB Fusion 2 controller to new RGBController API. Reworked some of the RGB Fusion 2 controller code to be more consistent with the rest of the project.
This commit is contained in:
1 parent
5a469ea615
commit
fbb718c532
6 files changed
+192
-85
No files matched your search
@@ -151,7 +151,13 @@ std::string RGBFusion2Controller::GetSerial()
|
||||
return(chip_id);
|
||||
}
|
||||
|
||||
void RGBFusion2Controller::SetStripColors(unsigned int hdr, int start, int end, std::vector<RGBColor>& colors, int single_led)
|
||||
void RGBFusion2Controller::SetStripColors
|
||||
(
|
||||
unsigned int hdr,
|
||||
RGBColor * colors,
|
||||
unsigned int num_colors,
|
||||
int single_led
|
||||
)
|
||||
{
|
||||
PktRGB pkt;
|
||||
pkt.Init(hdr, report_id);
|
||||
@@ -164,7 +170,7 @@ void RGBFusion2Controller::SetStripColors(unsigned int hdr, int start, int end,
|
||||
unsigned char bo_b = byteorder & 0xFF;
|
||||
|
||||
int res;
|
||||
int leds_left = end - start;
|
||||
int leds_left = num_colors;
|
||||
int sent_data = 0;
|
||||
int k = 0;
|
||||
int leds_in_pkt = sizeof(pkt.s.leds) / sizeof(*pkt.s.leds); /* 19 */
|
||||
@@ -174,7 +180,7 @@ void RGBFusion2Controller::SetStripColors(unsigned int hdr, int start, int end,
|
||||
if(single_led > -1)
|
||||
{
|
||||
leds_left = 1;
|
||||
k = single_led - start;
|
||||
k = single_led;
|
||||
sent_data = k * 3;
|
||||
leds_in_pkt = 1;
|
||||
}
|
||||
@@ -190,7 +196,7 @@ void RGBFusion2Controller::SetStripColors(unsigned int hdr, int start, int end,
|
||||
|
||||
for(int i = 0; i < leds_in_pkt; i++)
|
||||
{
|
||||
RGBColor color = colors[start + k];
|
||||
RGBColor color = colors[k];
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
@@ -160,7 +160,14 @@ public:
|
||||
RGBFusion2Controller(hid_device* handle, const char *path);
|
||||
~RGBFusion2Controller();
|
||||
|
||||
void SetStripColors(unsigned int hdr, int start, int end, std::vector<RGBColor>& colors, int single_led = -1);
|
||||
void SetStripColors
|
||||
(
|
||||
unsigned int hdr,
|
||||
RGBColor * colors,
|
||||
unsigned int num_colors,
|
||||
int single_led = -1
|
||||
);
|
||||
|
||||
void SetLEDEffect(unsigned int led, int mode, unsigned int speed, bool random, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetLedCount(unsigned int count);
|
||||
void SetMode(int mode);
|
||||
|
||||
Reference in new issue
Block a user