Add capability to set ring color
This commit is contained in:
parent
e79c97c4d0
commit
5ae3de993d
3 changed files with 56 additions and 6 deletions
|
|
@ -30,11 +30,7 @@ AMDWraithPrismController::AMDWraithPrismController(libusb_device_handle* dev_han
|
|||
strcpy(device_name, "AMD Wraith Prism");
|
||||
|
||||
SendEnableCommand();
|
||||
SendRemapCommand();
|
||||
//SendEffectCommand();
|
||||
SetFanColor(0xFF, 0x00, 0xFF);
|
||||
SetLogoColor(0x00, 0xFF, 0xFF);
|
||||
SetRingEffectChannel(0x07);
|
||||
SetRingEffectChannel(0x00);
|
||||
}
|
||||
|
||||
AMDWraithPrismController::~AMDWraithPrismController()
|
||||
|
|
@ -194,6 +190,38 @@ void AMDWraithPrismController::SetLogoColor(unsigned char red, unsigned char gre
|
|||
libusb_interrupt_transfer(dev, 0x83, usb_buf, 64, &actual, 0);
|
||||
}
|
||||
|
||||
void AMDWraithPrismController::SetRingColor(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
unsigned char usb_buf[] =
|
||||
{
|
||||
0x51, 0x2C, 0x01, 0x00,
|
||||
0x00, 0xFF, 0x00, 0xFF,
|
||||
0xFF, 0xFF, 0x00, 0xFF,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF
|
||||
};
|
||||
|
||||
int actual;
|
||||
|
||||
usb_buf[0x0A] = red;
|
||||
usb_buf[0x0B] = green;
|
||||
usb_buf[0x0C] = blue;
|
||||
|
||||
libusb_interrupt_transfer(dev, 0x04, usb_buf, 64, &actual, 0);
|
||||
libusb_interrupt_transfer(dev, 0x83, usb_buf, 64, &actual, 0);
|
||||
}
|
||||
|
||||
void AMDWraithPrismController::SetRingEffectChannel(unsigned char channel)
|
||||
{
|
||||
unsigned char usb_buf[] =
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public:
|
|||
|
||||
void SetFanColor(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetLogoColor(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetRingColor(unsigned char red, unsigned char green, unsigned char blue);
|
||||
|
||||
void SendEnableCommand();
|
||||
void SendRemapCommand();
|
||||
|
|
|
|||
|
|
@ -43,7 +43,19 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl
|
|||
std::vector<int> fan_zone_map;
|
||||
fan_zone_map.push_back(1);
|
||||
fan_zone.map.push_back(fan_zone_map);
|
||||
zones.push_back(fan_zone);
|
||||
zones.push_back(fan_zone);
|
||||
|
||||
led ring_led;
|
||||
ring_led.name = "Ring";
|
||||
leds.push_back(ring_led);
|
||||
|
||||
zone ring_zone;
|
||||
ring_zone.name = "Ring";
|
||||
ring_zone.type = ZONE_TYPE_SINGLE;
|
||||
std::vector<int> ring_zone_map;
|
||||
ring_zone_map.push_back(2);
|
||||
ring_zone.map.push_back(ring_zone_map);
|
||||
zones.push_back(ring_zone);
|
||||
}
|
||||
|
||||
RGBController_AMDWraithPrism::~RGBController_AMDWraithPrism()
|
||||
|
|
@ -74,6 +86,7 @@ void RGBController_AMDWraithPrism::SetAllLEDs(RGBColor color)
|
|||
|
||||
wraith->SetFanColor(red, grn, blu);
|
||||
wraith->SetLogoColor(red, grn, blu);
|
||||
wraith->SetRingColor(red, grn, blu);
|
||||
}
|
||||
|
||||
void RGBController_AMDWraithPrism::SetAllZoneLEDs(int zone, RGBColor color)
|
||||
|
|
@ -90,6 +103,10 @@ void RGBController_AMDWraithPrism::SetAllZoneLEDs(int zone, RGBColor color)
|
|||
{
|
||||
wraith->SetFanColor(red, grn, blu);
|
||||
}
|
||||
else if(zone == 2)
|
||||
{
|
||||
wraith->SetRingColor(red, grn, blu);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_AMDWraithPrism::SetLED(int led, RGBColor color)
|
||||
|
|
@ -106,6 +123,10 @@ void RGBController_AMDWraithPrism::SetLED(int led, RGBColor color)
|
|||
{
|
||||
wraith->SetFanColor(red, grn, blu);
|
||||
}
|
||||
else if(led == 2)
|
||||
{
|
||||
wraith->SetRingColor(red, grn, blu);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_AMDWraithPrism::UpdateLEDs()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue