Fix Commander Core XT when configuring RGB header zone to zero and when switching between zero and nonzero modes
This commit is contained in:
parent
e21d29fa27
commit
be9fe7bb2d
3 changed files with 51 additions and 24 deletions
|
|
@ -98,15 +98,7 @@ void CorsairCommanderCoreController::InitController()
|
||||||
command_res_size = packet_size - 4;
|
command_res_size = packet_size - 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------*\
|
SetFanMode(false);
|
||||||
| Wake up device |
|
|
||||||
\*-----------------------------------------------------*/
|
|
||||||
command[0] = 0x01;
|
|
||||||
command[1] = 0x03;
|
|
||||||
unsigned char cmd_data[2] = {0x00, 0x02};
|
|
||||||
SendCommand(command, cmd_data, 2, NULL);
|
|
||||||
|
|
||||||
SetFanMode();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CorsairCommanderCoreController::GetFirmwareString()
|
std::string CorsairCommanderCoreController::GetFirmwareString()
|
||||||
|
|
@ -394,14 +386,17 @@ void CorsairCommanderCoreController::SetDirectColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CorsairCommanderCoreController::SetFanMode()
|
void CorsairCommanderCoreController::SetFanMode(bool external_rgb_port)
|
||||||
{
|
{
|
||||||
controller_ready = 0;
|
controller_ready = 0;
|
||||||
DeviceGuardLock _ = guard_manager_ptr->AwaitExclusiveAccess();
|
DeviceGuardLock _ = guard_manager_ptr->AwaitExclusiveAccess();
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| Force controller to 6 QL fan mode to expose maximum number of LEDs per rgb port (34 LEDs per port) |
|
| Force controller to 6 QL fan mode to expose maximum |
|
||||||
\*--------------------------------------------------------------------------------------------------*/
|
| number of LEDs per rgb port (34 LEDs per port) |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
unsigned int index = 3;
|
||||||
|
unsigned int max_index = 15;
|
||||||
unsigned char endpoint[2] = {0x1E, 0x00};
|
unsigned char endpoint[2] = {0x1E, 0x00};
|
||||||
unsigned char data_type[2] = {0x0D, 0x00};
|
unsigned char data_type[2] = {0x0D, 0x00};
|
||||||
|
|
||||||
|
|
@ -415,17 +410,33 @@ void CorsairCommanderCoreController::SetFanMode()
|
||||||
buf[0] = 0x07;
|
buf[0] = 0x07;
|
||||||
if(pid == CORSAIR_COMMANDER_CORE_XT_PID)
|
if(pid == CORSAIR_COMMANDER_CORE_XT_PID)
|
||||||
{
|
{
|
||||||
/*-----------------------------------------------------*\
|
/*-------------------------------------------------*\
|
||||||
| Commander Core XT external RGB port |
|
| Commander Core XT external RGB port |
|
||||||
\*-----------------------------------------------------*/
|
\*-------------------------------------------------*/
|
||||||
buf[1] = 0x01;
|
if(external_rgb_port)
|
||||||
buf[2] = 0x01;
|
{
|
||||||
|
/*---------------------------------------------*\
|
||||||
|
| Enable external port |
|
||||||
|
\*---------------------------------------------*/
|
||||||
|
buf[1] = 0x01;
|
||||||
|
buf[2] = 0x01;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*---------------------------------------------*\
|
||||||
|
| Shift packet start position and maximum index |
|
||||||
|
\*---------------------------------------------*/
|
||||||
|
buf[1] = 0x00;
|
||||||
|
buf[2] = 0x00;
|
||||||
|
index = 2;
|
||||||
|
max_index = 14;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*-----------------------------------------------------*\
|
/*-------------------------------------------------*\
|
||||||
| Commander Core, Set AIO mode |
|
| Commander Core, Set AIO mode |
|
||||||
\*-----------------------------------------------------*/
|
\*-------------------------------------------------*/
|
||||||
buf[1] = 0x01;
|
buf[1] = 0x01;
|
||||||
buf[2] = 0x08;
|
buf[2] = 0x08;
|
||||||
}
|
}
|
||||||
|
|
@ -433,7 +444,7 @@ void CorsairCommanderCoreController::SetFanMode()
|
||||||
/*-----------------------------------------------------*\
|
/*-----------------------------------------------------*\
|
||||||
| SET fan modes |
|
| SET fan modes |
|
||||||
\*-----------------------------------------------------*/
|
\*-----------------------------------------------------*/
|
||||||
for(unsigned int i = 3; i < 15; i = i + 2)
|
for(unsigned int i = index; i < max_index; i = i + 2)
|
||||||
{
|
{
|
||||||
buf[i] = 0x01;
|
buf[i] = 0x01;
|
||||||
buf[i + 1] = 0x06;
|
buf[i + 1] = 0x06;
|
||||||
|
|
@ -441,6 +452,14 @@ void CorsairCommanderCoreController::SetFanMode()
|
||||||
|
|
||||||
WriteData(endpoint, data_type, buf, 15);
|
WriteData(endpoint, data_type, buf, 15);
|
||||||
controller_ready = 1;
|
controller_ready = 1;
|
||||||
|
|
||||||
|
/*-----------------------------------------------------*\
|
||||||
|
| Wake up device, needs to be done after setting fan |
|
||||||
|
| mode to reinitialize device if fan mode has changed |
|
||||||
|
\*-----------------------------------------------------*/
|
||||||
|
unsigned char command[2] = {0x01, 0x03};
|
||||||
|
unsigned char cmd_data[2] = {0x00, 0x02};
|
||||||
|
SendCommand(command, cmd_data, 2, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CorsairCommanderCoreController::SetLedAmount(int led_amount)
|
void CorsairCommanderCoreController::SetLedAmount(int led_amount)
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
void KeepaliveThread();
|
void KeepaliveThread();
|
||||||
void SetFanMode();
|
void SetFanMode(bool external_rgb_port);
|
||||||
void SetLedAmount(int led_amount);
|
void SetLedAmount(int led_amount);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,15 @@ void RGBController_CorsairCommanderCore::ResizeZone(int zone, int new_size)
|
||||||
zones[zone].leds_count = new_size;
|
zones[zone].leds_count = new_size;
|
||||||
if(zone == 0 && controller->GetPidInt() == CORSAIR_COMMANDER_CORE_XT_PID)
|
if(zone == 0 && controller->GetPidInt() == CORSAIR_COMMANDER_CORE_XT_PID)
|
||||||
{
|
{
|
||||||
controller->SetLedAmount(new_size);
|
if(new_size > 0)
|
||||||
|
{
|
||||||
|
controller->SetFanMode(true);
|
||||||
|
controller->SetLedAmount(new_size);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
controller->SetFanMode(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SetupZones();
|
SetupZones();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue