Add function to set all ring LEDs to a given effect channel

This commit is contained in:
Adam Honse 2019-12-24 15:04:30 -06:00
parent b35c900fae
commit 39b52326b6
2 changed files with 36 additions and 0 deletions

View file

@ -34,6 +34,7 @@ AMDWraithPrismController::AMDWraithPrismController(libusb_device_handle* dev_han
//SendEffectCommand();
SetFanColor(0xFF, 0x00, 0xFF);
SetLogoColor(0x00, 0xFF, 0xFF);
SetRingEffectChannel(0x07);
}
AMDWraithPrismController::~AMDWraithPrismController()
@ -146,6 +147,39 @@ void AMDWraithPrismController::SetLogoColor(unsigned char red, unsigned char gre
libusb_interrupt_transfer(dev, 0x83, usb_buf, 64, &actual, 0);
}
void AMDWraithPrismController::SetRingEffectChannel(unsigned char channel)
{
unsigned char usb_buf[] =
{
0x51, 0xA0, 0x01, 0x00,
0x00, 0x03, 0x00, 0x00,
0x05, 0x06, 0x07, 0x07,
0x07, 0x07, 0x07, 0x07,
0x07, 0x07, 0x07, 0x07,
0x07, 0x07, 0x07, 0x07,
0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
int actual;
for(int led = 0x0A; led <= 0x18; led++)
{
usb_buf[led] = channel;
}
libusb_interrupt_transfer(dev, 0x04, usb_buf, 64, &actual, 0);
libusb_interrupt_transfer(dev, 0x83, usb_buf, 64, &actual, 0);
}
void AMDWraithPrismController::SendEnableCommand()
{
unsigned char usb_buf[] =

View file

@ -20,6 +20,8 @@ public:
std::string GetEffectChannelString(unsigned char channel);
void SetRingEffectChannel(unsigned char channel);
void SetFanColor(unsigned char red, unsigned char green, unsigned char blue);
void SetLogoColor(unsigned char red, unsigned char green, unsigned char blue);