@@ -137,17 +137,17 @@ RGBController_AMDWraithPrism::~RGBController_AMDWraithPrism()
137137
138138void RGBController_AMDWraithPrism::SetupZones ()
139139{
140- /* --------------------------------------------------------- *\
141- | LED maps |
142- \*--------------------------------------------------------- */
140+ /* -----------------------------------------------------*\
141+ | LED maps |
142+ \*-----------------------------------------------------*/
143143 const unsigned int logo_leds[1 ] = { 0x00 };
144144 const unsigned int fan_leds[1 ] = { 0x01 };
145- const unsigned int ring_leds[14 ] = { 0x07 , 0x06 , 0x05 , 0x04 , 0x03 , 0x02 , 0x10 , 0x0F ,
146- 0x0E , 0x0D , 0x0C , 0x0B , 0x0A , 0x09 };
145+ const unsigned int ring_leds[15 ] = { 0x08 , 0x07 , 0x06 , 0x05 , 0x04 , 0x03 , 0x02 , 0x10 ,
146+ 0x0F , 0x0E , 0x0D , 0x0C , 0x0B , 0x0A , 0x09 };
147147
148- /* --------------------------------------------------------- *\
149- | Set up zones |
150- \*--------------------------------------------------------- */
148+ /* -----------------------------------------------------*\
149+ | Set up zones |
150+ \*-----------------------------------------------------*/
151151 zone logo_zone;
152152 logo_zone.name = " Logo" ;
153153 logo_zone.type = ZONE_TYPE_SINGLE;
@@ -169,15 +169,15 @@ void RGBController_AMDWraithPrism::SetupZones()
169169 zone ring_zone;
170170 ring_zone.name = " Ring" ;
171171 ring_zone.type = ZONE_TYPE_LINEAR;
172- ring_zone.leds_min = 14 ;
173- ring_zone.leds_max = 14 ;
174- ring_zone.leds_count = 14 ;
172+ ring_zone.leds_min = 15 ;
173+ ring_zone.leds_max = 15 ;
174+ ring_zone.leds_count = 15 ;
175175 ring_zone.matrix_map = NULL ;
176176 zones.push_back (ring_zone);
177177
178- /* --------------------------------------------------------- *\
179- | Set up LEDs |
180- \*--------------------------------------------------------- */
178+ /* -----------------------------------------------------*\
179+ | Set up LEDs |
180+ \*-----------------------------------------------------*/
181181 for (unsigned int led_idx = 0 ; led_idx < 1 ; led_idx++)
182182 {
183183 led logo_led;
@@ -194,7 +194,7 @@ void RGBController_AMDWraithPrism::SetupZones()
194194 leds.push_back (fan_led);
195195 }
196196
197- for (unsigned int led_idx = 0 ; led_idx < 14 ; led_idx++)
197+ for (unsigned int led_idx = 0 ; led_idx < 15 ; led_idx++)
198198 {
199199 led ring_led;
200200 ring_led.name = " Ring LED" ;
@@ -207,37 +207,44 @@ void RGBController_AMDWraithPrism::SetupZones()
207207
208208void RGBController_AMDWraithPrism::ResizeZone (int /* zone*/ , int /* new_size*/ )
209209{
210- /* --------------------------------------------------------- *\
211- | This device does not support resizing zones |
212- \*--------------------------------------------------------- */
210+ /* -----------------------------------------------------*\
211+ | This device does not support resizing zones |
212+ \*-----------------------------------------------------*/
213213}
214214
215215void RGBController_AMDWraithPrism::DeviceUpdateLEDs ()
216216{
217217 if (modes[active_mode].color_mode == MODE_COLORS_PER_LED)
218218 {
219- unsigned char led_ids[15 ];
220- RGBColor color_buf[15 ];
221- unsigned int leds_count = 0 ;
222-
223- for (unsigned int led_idx = 0 ; led_idx < colors.size (); led_idx++)
219+ unsigned char led_ids[17 ];
220+ RGBColor color_buf[17 ];
221+ unsigned int leds_count;
222+
223+ /* -------------------------------------------------*\
224+ | Send logo and fan LEDs in the first packet |
225+ \*-------------------------------------------------*/
226+ leds_count = 0 ;
227+ for (std::size_t led_idx = 0 ; led_idx < 2 ; led_idx++)
224228 {
225229 led_ids[leds_count] = (unsigned char )leds[led_idx].value ;
226230 color_buf[leds_count] = colors[led_idx];
227231
228232 leds_count++;
229-
230- if (leds_count >= 15 )
231- {
232- controller->SendDirectPacket (15 , led_ids, color_buf);
233- leds_count = 0 ;
234- }
235233 }
234+ controller->SendDirectPacket (leds_count, led_ids, color_buf);
236235
237- if (leds_count > 0 )
236+ /* -------------------------------------------------*\
237+ | Send all ring LEDs in the second packet |
238+ \*-------------------------------------------------*/
239+ leds_count = 0 ;
240+ for (std::size_t led_idx = 0 ; led_idx < ( colors.size () - 2 ); led_idx++)
238241 {
239- controller->SendDirectPacket (leds_count, led_ids, color_buf);
242+ led_ids[leds_count] = (unsigned char )leds[led_idx + 2 ].value ;
243+ color_buf[leds_count] = colors[led_idx + 2 ];
244+
245+ leds_count++;
240246 }
247+ controller->SendDirectPacket (leds_count, led_ids, color_buf);
241248 }
242249 else if (modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
243250 {
0 commit comments