Add UpdateLEDs function support for Viper, Hue2, Hue+, Wraith Prism

This commit is contained in:
Adam Honse
2020-01-05 18:07:47 -06:00
parent f6bf044ba0
commit f45b20602b
4 changed files with 44 additions and 7 deletions

View File

@@ -131,5 +131,18 @@ void RGBController_AMDWraithPrism::SetLED(int led, RGBColor color)
void RGBController_AMDWraithPrism::UpdateLEDs()
{
unsigned char red = RGBGetRValue(colors[0]);
unsigned char grn = RGBGetGValue(colors[0]);
unsigned char blu = RGBGetBValue(colors[0]);
wraith->SetLogoColor(red, grn, blu);
red = RGBGetRValue(colors[1]);
grn = RGBGetGValue(colors[1]);
blu = RGBGetBValue(colors[1]);
wraith->SetFanColor(red, grn, blu);
red = RGBGetRValue(colors[2]);
grn = RGBGetGValue(colors[2]);
blu = RGBGetBValue(colors[2]);
wraith->SetRingColor(red, grn, blu);
}

View File

@@ -134,10 +134,12 @@ void RGBController_Hue2::SetLED(int led, RGBColor color)
void RGBController_Hue2::UpdateLEDs()
{
std::vector<RGBColor> channel_colors;
for(unsigned int channel = 0; channel < HUE_2_NUM_CHANNELS; channel++)
for(std::size_t zone_idx = 0; zone_idx <= zones.size(); zone_idx++)
{
unsigned int channel = zones_channel[zone_idx];
std::vector<RGBColor> channel_colors;
for(std::size_t color = 0; color < colors.size(); color++)
{
if(leds_channel[color] == channel)
@@ -150,7 +152,5 @@ void RGBController_Hue2::UpdateLEDs()
{
hue2->SetChannelLEDs(channel, channel_colors);
}
channel_colors.clear();
}
}

View File

@@ -136,5 +136,23 @@ void RGBController_HuePlus::SetLED(int led, RGBColor color)
void RGBController_HuePlus::UpdateLEDs()
{
hueplus->SetChannelLEDs(0, colors);
for(std::size_t zone_idx = 0; zone_idx <= zones.size(); zone_idx++)
{
unsigned int channel = zones_channel[zone_idx];
std::vector<RGBColor> channel_colors;
for(std::size_t color = 0; color < colors.size(); color++)
{
if(leds_channel[color] == channel)
{
channel_colors.push_back(colors[color]);
}
}
if(channel_colors.size() > 0)
{
hueplus->SetChannelLEDs(channel, channel_colors);
}
}
}

View File

@@ -94,7 +94,13 @@ void RGBController_PatriotViper::SetLED(int led, RGBColor color)
void RGBController_PatriotViper::UpdateLEDs()
{
for(int led = 0; led < 5; led++)
{
unsigned char red = RGBGetRValue(colors[led]);
unsigned char grn = RGBGetGValue(colors[led]);
unsigned char blu = RGBGetBValue(colors[led]);
viper->SetLEDColor(led, red, grn, blu);
}
}
RGBController_PatriotViper::RGBController_PatriotViper(PatriotViperController* viper_ptr)