fix led enumeration when lcd cap is installed

This commit is contained in:
Nikola Jurkovic 2025-08-12 13:47:23 +00:00 committed by Adam Honse
parent f3c7a213b1
commit 2a6856a5d2
3 changed files with 49 additions and 9 deletions

View file

@ -107,8 +107,10 @@ void CorsairICueLinkController::GetControllerDevices()
continue;
}
// Dont process internal device due to duplication
if (device->internal == true)
/*-------------------------------------------------*\
| Dont process internal device due to duplication |
\*-------------------------------------------------*/
if(device->internal == true)
{
pos += 8 + device_id_length;
continue;
@ -289,14 +291,24 @@ void CorsairICueLinkController::Write(std::vector<unsigned char> endpoint, std::
}
SendCommand(CORSAIR_ICUE_LINK_CMD_OPEN_COLOR_ENDPOINT, endpoint, { });
std::vector<unsigned char> write_color_ep = CORSAIR_ICUE_LINK_CMD_WRITE_COLOR;
std::vector<std::vector<unsigned char>> chunks = ProcessMultiChunkPacket(buf, CORSAIR_ICUE_LINK_MAXIMUM_BUFFER_PER_REQUEST);
for(size_t i = 0; i < chunks.size(); i++)
{
write_color_ep[0] = write_color_ep[0] + (unsigned char)i;
SendCommand(write_color_ep, chunks[i], {});
if(i == 0)
{
/*-----------------------------------------------------*\
| Initial color packet |
\*-----------------------------------------------------*/
SendCommand(CORSAIR_ICUE_LINK_CMD_WRITE_COLOR, chunks[i], {});
}
else
{
/*-----------------------------------------------------*\
| Everything else follows 0x07, 0x00 |
\*-----------------------------------------------------*/
SendCommand(CORSAIR_ICUE_LINK_CMD_WRITE_COLOR_NEXT, chunks[i], {});
}
}
SendCommand(CORSAIR_ICUE_LINK_CMD_CLOSE_ENDPOINT, endpoint, { });

View file

@ -73,6 +73,7 @@ static const CorsairICueLinkDevice known_devices[] =
#define CORSAIR_ICUE_LINK_CMD_HARDWARE_MODE {0x01, 0x03, 0x00, 0x01}
#define CORSAIR_ICUE_LINK_CMD_WRITE {0x06, 0x01}
#define CORSAIR_ICUE_LINK_CMD_WRITE_COLOR {0x06, 0x00}
#define CORSAIR_ICUE_LINK_CMD_WRITE_COLOR_NEXT {0x07, 0x00}
#define CORSAIR_ICUE_LINK_CMD_READ {0x08, 0x01}
#define CORSAIR_ICUE_LINK_CMD_GET_DEVICE_MODE {0x01, 0x08, 0x01}
@ -96,4 +97,4 @@ typedef enum CORSAIR_ICUE_ENDPOINT_TYPE
CORSAIR_ICUE_ENDPOINT_TYPE_COLOR
} CORSAIR_ICUE_ENDPOINT_TYPE;
const CorsairICueLinkDevice* FindCorsairICueLinkDevice(unsigned char type, unsigned char model);
const CorsairICueLinkDevice* FindCorsairICueLinkDevice(unsigned char type, unsigned char model);

View file

@ -5,6 +5,7 @@
| |
| Aiden Vigue (acvigue) 02 Mar 2025 |
| Adam Honse <calcprogrammer1@gmail.com> 01 Aug 2025 |
| Nikola Jurkovic (jurkovic.nikola) 11 Aug 2025 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-only |
@ -64,16 +65,42 @@ void RGBController_CorsairICueLink::SetupZones()
{
for(std::size_t zone_idx = 0; zone_idx < controller->GetEndpoints().size(); zone_idx++)
{
zone new_zone;
if(controller->GetEndpoints()[zone_idx]->type == 0x06)
{
/*-----------------------------------------------------*\
| We skip LCD processing here |
\*-----------------------------------------------------*/
continue;
}
zone new_zone;
new_zone.name = controller->GetEndpoints()[zone_idx]->display_name;
new_zone.type = ZONE_TYPE_LINEAR;
new_zone.leds_min = controller->GetEndpoints()[zone_idx]->led_channels;
new_zone.leds_max = new_zone.leds_min;
new_zone.leds_count = new_zone.leds_min;
zones.push_back(new_zone);
if(controller->GetEndpoints()[zone_idx]->type == 0x07 || controller->GetEndpoints()[zone_idx]->type == 0x11)
{
/*---------------------------------------------------------*\
| iCUE LINK AIO 'H' Series || iCUE LINK AIO 'TITAN' Series |
\*---------------------------------------------------------*/
for(std::size_t lcd_idx = 0; lcd_idx < controller->GetEndpoints().size(); lcd_idx++)
{
if(controller->GetEndpoints()[lcd_idx]->type == 0x06)
{
zone lcd_zone;
lcd_zone.name = controller->GetEndpoints()[lcd_idx]->display_name;
lcd_zone.type = ZONE_TYPE_LINEAR;
lcd_zone.leds_min = controller->GetEndpoints()[lcd_idx]->led_channels;
lcd_zone.leds_max = lcd_zone.leds_min;
lcd_zone.leds_count = lcd_zone.leds_min;
zones.push_back(lcd_zone);
}
}
}
for(unsigned int led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
{
led new_led;