Fix Thermaltake Riing controller

master
Adam Honse 6 years ago
parent 57b8377f5a
commit da54e89839

@ -41,7 +41,7 @@ void ThermaltakeRiingController::SetChannelLEDs(unsigned char channel, RGBColor
color_data[color_idx + 2] = RGBGetBValue(colors[color]); color_data[color_idx + 2] = RGBGetBValue(colors[color]);
} }
SendRGB(channel, current_mode, current_speed, num_colors, color_data); SendRGB(channel + 1, current_mode, current_speed, num_colors, color_data);
delete[] color_data; delete[] color_data;
} }

@ -42,6 +42,8 @@ enum
THERMALTAKE_SPEED_EXTREME = 0x00 THERMALTAKE_SPEED_EXTREME = 0x00
}; };
#define THERMALTAKE_NUM_CHANNELS 5
class ThermaltakeRiingController class ThermaltakeRiingController
{ {
public: public:
@ -51,7 +53,7 @@ public:
void SetChannelLEDs(unsigned char channel, RGBColor * colors, unsigned int num_colors); void SetChannelLEDs(unsigned char channel, RGBColor * colors, unsigned int num_colors);
void SetMode(unsigned char mode, unsigned char speed); void SetMode(unsigned char mode, unsigned char speed);
unsigned int channel_leds[5]; unsigned int channel_leds[THERMALTAKE_NUM_CHANNELS];
private: private:
libusb_device_handle* dev; libusb_device_handle* dev;

@ -115,40 +115,37 @@ void RGBController_ThermaltakeRiing::SetupZones()
/*-------------------------------------------------*\ /*-------------------------------------------------*\
| Set zones and leds | | Set zones and leds |
\*-------------------------------------------------*/ \*-------------------------------------------------*/
for (unsigned int channel_idx = 0; channel_idx < 5; channel_idx++) for (unsigned int channel_idx = 0; channel_idx < THERMALTAKE_NUM_CHANNELS; channel_idx++)
{ {
if(riing->channel_leds[channel_idx] > 0) zone* new_zone = new zone;
{
zone* new_zone = new zone;
char ch_idx_string[2];
sprintf(ch_idx_string, "%d", channel_idx + 1);
new_zone->name = "Riing Channel "; char ch_idx_string[2];
new_zone->name.append(ch_idx_string); sprintf(ch_idx_string, "%d", channel_idx + 1);
new_zone->type = ZONE_TYPE_LINEAR;
new_zone->leds_min = 0; new_zone->name = "Riing Channel ";
new_zone->leds_max = 60; new_zone->name.append(ch_idx_string);
new_zone->leds_count = riing->channel_leds[channel_idx]; new_zone->type = ZONE_TYPE_LINEAR;
for (unsigned int led_ch_idx = 0; led_ch_idx < riing->channel_leds[channel_idx]; led_ch_idx++) new_zone->leds_min = 0;
{ new_zone->leds_max = 60;
char led_idx_string[3]; new_zone->leds_count = riing->channel_leds[channel_idx];
sprintf(led_idx_string, "%d", led_ch_idx + 1);
led new_led; for (unsigned int led_ch_idx = 0; led_ch_idx < riing->channel_leds[channel_idx]; led_ch_idx++)
new_led.name = "Riing Channel "; {
new_led.name.append(ch_idx_string); char led_idx_string[3];
new_led.name.append(", LED "); sprintf(led_idx_string, "%d", led_ch_idx + 1);
new_led.name.append(led_idx_string);
leds.push_back(new_led); led new_led;
leds_channel.push_back(channel_idx + 1); new_led.name = "Riing Channel ";
} new_led.name.append(ch_idx_string);
new_led.name.append(", LED ");
new_led.name.append(led_idx_string);
zones.push_back(*new_zone); leds.push_back(new_led);
leds_channel.push_back(channel_idx);
} }
zones.push_back(*new_zone);
} }
SetupColors(); SetupColors();

Loading…
Cancel
Save