Apply changes from \!1275 code review

This commit is contained in:
Adam Honse 2022-08-09 19:06:51 -05:00
parent 8b02484456
commit 3af17b6d8e
3 changed files with 10 additions and 7 deletions

View file

@ -165,10 +165,12 @@ void PolychromeUSBController::WriteZone
hid_read(dev, usb_buf, 64);
};
void PolychromeUSBController::WriteAllZones (
const std::vector<PolychromeZoneInfo> &zones_info,
const std::vector<zone> &zones
){
void PolychromeUSBController::WriteAllZones
(
const std::vector<PolychromeZoneInfo>& zones_info,
const std::vector<zone>& zones
)
{
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
@ -183,12 +185,14 @@ void PolychromeUSBController::WriteAllZones (
usb_buf[0x03] = 0x07;
usb_buf[0x04] = zones_info[0].mode;
usb_buf[0x04] = 0xE2;
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
usb_buf[0x05 + (3 * zone_idx)] = RGBGetRValue(zones[zone_idx].colors[0]);
usb_buf[0x05 + (3 * zone_idx) ] = RGBGetRValue(zones[zone_idx].colors[0]);
usb_buf[0x05 + (3 * zone_idx) + 1] = RGBGetGValue(zones[zone_idx].colors[0]);
usb_buf[0x05 + (3 * zone_idx) + 2] = RGBGetBValue(zones[zone_idx].colors[0]);
}
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/

View file

@ -134,7 +134,6 @@ public:
const std::vector<zone> &zones
);
void WriteHeader
(
unsigned char cfg,

View file

@ -338,7 +338,7 @@ unsigned char RGBController_PolychromeUSB::GetDeviceMode(unsigned char zone)
void RGBController_PolychromeUSB::SetCustomMode()
{
active_mode = POLYCHROME_USB_MODE_STATIC;
active_mode = POLYCHROME_USB_MODE_DIRECT;
}
void RGBController_PolychromeUSB::DeviceUpdateMode()