mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-18 11:35:21 -04:00
Code style cleanup for MSI GPU controller
This commit is contained in:
@@ -26,13 +26,16 @@ bool IsMSIGPUController(i2c_smbus_interface* bus)
|
||||
bool pass = false;
|
||||
|
||||
if (bus->port_id != 1)
|
||||
{
|
||||
return(pass);
|
||||
}
|
||||
|
||||
// MSI RTX 2080S Gaming X Trio
|
||||
if (bus->pci_device == 0x1e81 &&
|
||||
bus->pci_vendor == 0x10de &&
|
||||
bus->pci_subsystem_device == 0xc724 &&
|
||||
bus->pci_subsystem_vendor == 0x1462) {
|
||||
bus->pci_subsystem_vendor == 0x1462)
|
||||
{
|
||||
pass = true;
|
||||
}
|
||||
|
||||
@@ -40,7 +43,8 @@ bool IsMSIGPUController(i2c_smbus_interface* bus)
|
||||
if (bus->pci_device == 0x1e84 &&
|
||||
bus->pci_vendor == 0x10de &&
|
||||
bus->pci_subsystem_device == 0xc726 &&
|
||||
bus->pci_subsystem_vendor == 0x1462) {
|
||||
bus->pci_subsystem_vendor == 0x1462)
|
||||
{
|
||||
pass = true;
|
||||
}
|
||||
|
||||
@@ -48,7 +52,8 @@ bool IsMSIGPUController(i2c_smbus_interface* bus)
|
||||
if (bus->pci_device == 0x1e07 &&
|
||||
bus->pci_vendor == 0x10de &&
|
||||
bus->pci_subsystem_device == 0x3717 &&
|
||||
bus->pci_subsystem_vendor == 0x1462) {
|
||||
bus->pci_subsystem_vendor == 0x1462)
|
||||
{
|
||||
pass = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "RGBController_MSIGPU.h"
|
||||
|
||||
static unsigned char brightness_values[] = { 0x14, 0x28, 0x3c, 0x50, 0x64 };
|
||||
static unsigned char speed_values[] = { 0x04, 0x02, 0x01 };
|
||||
static unsigned char speed_values[] = { 0x04, 0x02, 0x01 };
|
||||
|
||||
int RGBController_MSIGPU::GetDeviceMode()
|
||||
{
|
||||
@@ -274,17 +274,30 @@ void RGBController_MSIGPU::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
void RGBController_MSIGPU::DeviceUpdateLEDs()
|
||||
{
|
||||
if (modes[active_mode].flags & MODE_FLAG_HAS_BRIGHTNESS)
|
||||
{
|
||||
msi_gpu->MSIGPURegisterWrite(MSI_GPU_REG_BRIGHTNESS, brightness_values[4]); // how to access brightness value?
|
||||
}
|
||||
|
||||
if (modes[active_mode].flags & MODE_FLAG_HAS_SPEED)
|
||||
{
|
||||
msi_gpu->MSIGPURegisterWrite(MSI_GPU_REG_SPEED, speed_values[modes[active_mode].speed]);
|
||||
}
|
||||
|
||||
msi_gpu->MSIGPURegisterWrite(MSI_GPU_REG_UNKNOWN, 0x00);
|
||||
if (modes[active_mode].flags & MODE_FLAG_HAS_PER_LED_COLOR) {
|
||||
if (modes[active_mode].value == MSI_GPU_MODE_FADEIN) {
|
||||
|
||||
if (modes[active_mode].flags & MODE_FLAG_HAS_PER_LED_COLOR)
|
||||
{
|
||||
if (modes[active_mode].value == MSI_GPU_MODE_FADEIN)
|
||||
{
|
||||
msi_gpu->SetRGB2(RGBGetRValue(colors[1]), RGBGetGValue(colors[1]), RGBGetBValue(colors[1]));
|
||||
msi_gpu->SetRGB3(RGBGetRValue(colors[2]), RGBGetGValue(colors[2]), RGBGetBValue(colors[2]));
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
msi_gpu->SetRGB1(RGBGetRValue(colors[0]), RGBGetGValue(colors[0]), RGBGetBValue(colors[0]));
|
||||
}
|
||||
}
|
||||
|
||||
msi_gpu->SetMode(modes[active_mode].value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user