mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-03-24 17:01:05 -04:00
Greatly reduce flickering of HyperX DRAM by saving the apply until all LEDs have been written
This commit is contained in:
@@ -76,6 +76,12 @@ unsigned int HyperXDRAMController::GetMode()
|
||||
return(mode);
|
||||
}
|
||||
|
||||
void HyperXDRAMController::SendApply()
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x02);
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
|
||||
}
|
||||
|
||||
void HyperXDRAMController::SetEffectColor(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x01);
|
||||
@@ -179,9 +185,6 @@ void HyperXDRAMController::SetLEDColor(unsigned int slot, unsigned int led, unsi
|
||||
bus->i2c_smbus_write_byte_data(dev, green_base + (3 * led), green);
|
||||
bus->i2c_smbus_write_byte_data(dev, blue_base + (3 * led), blue );
|
||||
bus->i2c_smbus_write_byte_data(dev, bright_base + (3 * led), 0x64 );
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x02);
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
|
||||
}
|
||||
|
||||
void HyperXDRAMController::SetMode(unsigned char new_mode, bool random, unsigned short new_speed)
|
||||
|
||||
@@ -212,8 +212,11 @@ public:
|
||||
unsigned int GetLEDCount();
|
||||
unsigned int GetSlotCount();
|
||||
unsigned int GetMode();
|
||||
void SetMode(unsigned char new_mode, bool random, unsigned short new_speed);
|
||||
|
||||
void SendApply();
|
||||
|
||||
void SetMode(unsigned char new_mode, bool random, unsigned short new_speed);
|
||||
|
||||
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetEffectColor(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
|
||||
@@ -181,6 +181,7 @@ void RGBController_HyperXDRAM::DeviceUpdateLEDs()
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
hyperx->SetLEDColor(led_idx, red, grn, blu);
|
||||
}
|
||||
hyperx->SendApply();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -204,6 +205,7 @@ void RGBController_HyperXDRAM::UpdateZoneLEDs(int zone)
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
hyperx->SetLEDColor(led, red, grn, blu);
|
||||
}
|
||||
hyperx->SendApply();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -229,6 +231,7 @@ void RGBController_HyperXDRAM::UpdateSingleLED(int led)
|
||||
{
|
||||
hyperx->SetEffectColor(red, grn, blu);
|
||||
}
|
||||
hyperx->SendApply();
|
||||
}
|
||||
|
||||
void RGBController_HyperXDRAM::SetCustomMode()
|
||||
|
||||
Reference in New Issue
Block a user