@@ -76,11 +76,19 @@ void PolychromeUSBController::SetDeviceInfo()
76
76
{
77
77
if (configtable[zonecnt] == 0x1E )
78
78
{
79
- break ;
79
+ /* -----------------------------------------------------------------------*\
80
+ | If we don't have this device type (0x1E) we will skip it and continue. |
81
+ \*-----------------------------------------------------------------------*/
82
+ continue ;
80
83
}
81
84
82
85
newdev_info.num_leds = configtable[zonecnt];
83
86
87
+ /* --------------------------------------------------------------------------------------------------*\
88
+ | We will need to know what zone type this is, so that we can look up the name and make calls later. |
89
+ \*--------------------------------------------------------------------------------------------------*/
90
+ newdev_info.zone_type = zonecnt;
91
+
84
92
switch (zonecnt)
85
93
{
86
94
/* -----------------------------------------*\
@@ -124,6 +132,12 @@ void PolychromeUSBController::WriteZone
124
132
bool allzone = false
125
133
)
126
134
{
135
+
136
+ /* ----------------------------------------------------*\
137
+ | Get the device info so we can look up the zone type. |
138
+ \*----------------------------------------------------*/
139
+ PolychromeDeviceInfo device_info = GetPolychromeDevices ()[zone];
140
+
127
141
unsigned char usb_buf[65 ];
128
142
129
143
/* -----------------------------------------------------*\
@@ -135,7 +149,7 @@ void PolychromeUSBController::WriteZone
135
149
| Set up message packet with leading 00 |
136
150
\*-----------------------------------------------------*/
137
151
usb_buf[0x01 ] = POLYCHROME_USB_SET_ZONE;
138
- usb_buf[0x03 ] = zone;
152
+ usb_buf[0x03 ] = device_info. zone_type ;
139
153
usb_buf[0x04 ] = mode;
140
154
usb_buf[0x05 ] = RGBGetRValue (rgb);
141
155
usb_buf[0x06 ] = RGBGetGValue (rgb);
@@ -211,9 +225,13 @@ void PolychromeUSBController::WriteHeader
211
225
212
226
PolychromeZoneInfo PolychromeUSBController::GetZoneConfig (unsigned char zone)
213
227
{
228
+ /* -----------------------------------------------------*\
229
+ | Get the device info so we can look up the zone type |
230
+ \*-----------------------------------------------------*/
231
+ PolychromeDeviceInfo device_info = GetPolychromeDevices ()[zone];
232
+
214
233
unsigned char usb_buf[65 ];
215
234
PolychromeZoneInfo zoneinfo;
216
- // unsigned char all;
217
235
unsigned char r;
218
236
unsigned char g;
219
237
unsigned char b;
@@ -227,7 +245,7 @@ PolychromeZoneInfo PolychromeUSBController::GetZoneConfig(unsigned char zone)
227
245
| Set up config table request packet |
228
246
\*-----------------------------------------------------*/
229
247
usb_buf[0x01 ] = POLYCHROME_USB_READ_ZONE_CONFIG;
230
- usb_buf[0x03 ] = zone ;
248
+ usb_buf[0x03 ] = device_info. zone_type ;
231
249
232
250
/* -----------------------------------------------------*\
233
251
| Send packet |
@@ -248,7 +266,6 @@ PolychromeZoneInfo PolychromeUSBController::GetZoneConfig(unsigned char zone)
248
266
zoneinfo.color = ToRGBColor (r,g,b);
249
267
zoneinfo.speed = usb_buf[0x08 ];
250
268
zoneinfo.zone = usb_buf[0x03 ];
251
- // all = usb_buf[0x10];
252
269
253
270
return (zoneinfo);
254
271
}
0 commit comments