diff --git a/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUController.cpp b/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUController.cpp index ab329d2b..62f1b52f 100644 --- a/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUController.cpp +++ b/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUController.cpp @@ -63,3 +63,20 @@ void RGBFusionGPUController::SetMode(unsigned char mode, unsigned char speed, un bus->i2c_smbus_write_byte(dev, 0x00); } } + +void RGBFusionGPUController::Save() +{ + bus->i2c_smbus_write_byte(dev, RGB_FUSION_GPU_REG_SAVE); + bus->i2c_smbus_write_byte(dev, 0x00); + bus->i2c_smbus_write_byte(dev, 0x00); + bus->i2c_smbus_write_byte(dev, 0x00); + + // Pad commands with 4 zero-bytes for NVIDIA_RTX3060_DEV + if (dev == 0x62) + { + bus->i2c_smbus_write_byte(dev, 0x00); + bus->i2c_smbus_write_byte(dev, 0x00); + bus->i2c_smbus_write_byte(dev, 0x00); + bus->i2c_smbus_write_byte(dev, 0x00); + } +} \ No newline at end of file diff --git a/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUController.h b/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUController.h index ba73e2d6..df7d5a2a 100644 --- a/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUController.h +++ b/Controllers/GigabyteRGBFusionGPUController/GigabyteRGBFusionGPUController.h @@ -17,7 +17,8 @@ typedef unsigned char rgb_fusion_dev_id; enum { RGB_FUSION_GPU_REG_COLOR = 0x40, - RGB_FUSION_GPU_REG_MODE = 0x88 + RGB_FUSION_GPU_REG_MODE = 0x88, + RGB_FUSION_GPU_REG_SAVE = 0xAA, }; enum @@ -52,6 +53,7 @@ public: void SetColor(unsigned char red, unsigned char green, unsigned char blue); void SetMode(unsigned char mode, unsigned char speed, unsigned char brightness); + void Save(); private: i2c_smbus_interface* bus; diff --git a/Controllers/GigabyteRGBFusionGPUController/RGBController_GigabyteRGBFusionGPU.cpp b/Controllers/GigabyteRGBFusionGPUController/RGBController_GigabyteRGBFusionGPU.cpp index 9638553f..e28c30f2 100644 --- a/Controllers/GigabyteRGBFusionGPUController/RGBController_GigabyteRGBFusionGPU.cpp +++ b/Controllers/GigabyteRGBFusionGPUController/RGBController_GigabyteRGBFusionGPU.cpp @@ -23,7 +23,7 @@ RGBController_RGBFusionGPU::RGBController_RGBFusionGPU(RGBFusionGPUController* r mode Direct; Direct.name = "Direct"; Direct.value = RGB_FUSION_GPU_MODE_STATIC; - Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS; + Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE; Direct.color_mode = MODE_COLORS_PER_LED; Direct.brightness_min = RGB_FUSION_GPU_BRIGHTNESS_MIN; Direct.brightness_max = RGB_FUSION_GPU_BRIGHTNESS_MAX; @@ -33,7 +33,7 @@ RGBController_RGBFusionGPU::RGBController_RGBFusionGPU(RGBFusionGPUController* r mode Breathing; Breathing.name = "Breathing"; Breathing.value = RGB_FUSION_GPU_MODE_BREATHING; - Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS; + Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE; Breathing.speed_min = RGB_FUSION_GPU_SPEED_SLOWEST; Breathing.speed_max = RGB_FUSION_GPU_SPEED_FASTEST; Breathing.speed = RGB_FUSION_GPU_SPEED_NORMAL; @@ -46,7 +46,7 @@ RGBController_RGBFusionGPU::RGBController_RGBFusionGPU(RGBFusionGPUController* r mode Flashing; Flashing.name = "Flashing"; Flashing.value = RGB_FUSION_GPU_MODE_FLASHING; - Flashing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS; + Flashing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE; Flashing.speed_min = RGB_FUSION_GPU_SPEED_SLOWEST; Flashing.speed_max = RGB_FUSION_GPU_SPEED_FASTEST; Flashing.speed = RGB_FUSION_GPU_SPEED_NORMAL; @@ -59,7 +59,7 @@ RGBController_RGBFusionGPU::RGBController_RGBFusionGPU(RGBFusionGPUController* r mode DualFlashing; DualFlashing.name = "Dual Flashing"; DualFlashing.value = RGB_FUSION_GPU_MODE_DUAL_FLASHING; - DualFlashing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS; + DualFlashing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE; DualFlashing.speed_min = RGB_FUSION_GPU_SPEED_SLOWEST; DualFlashing.speed_max = RGB_FUSION_GPU_SPEED_FASTEST; DualFlashing.speed = RGB_FUSION_GPU_SPEED_NORMAL; @@ -72,7 +72,7 @@ RGBController_RGBFusionGPU::RGBController_RGBFusionGPU(RGBFusionGPUController* r mode SpectrumCycle; SpectrumCycle.name = "Spectrum Cycle"; SpectrumCycle.value = RGB_FUSION_GPU_MODE_SPECTRUM_CYCLE; - SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS; + SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE; SpectrumCycle.speed_min = RGB_FUSION_GPU_SPEED_SLOWEST; SpectrumCycle.speed_max = RGB_FUSION_GPU_SPEED_FASTEST; SpectrumCycle.speed = RGB_FUSION_GPU_SPEED_NORMAL; @@ -156,3 +156,9 @@ void RGBController_RGBFusionGPU::DeviceUpdateMode() { rgb_fusion->SetMode((unsigned char)modes[(unsigned int)active_mode].value, (unsigned char)modes[(unsigned int)active_mode].speed, (unsigned char)modes[(unsigned int)active_mode].brightness); } + +void RGBController_RGBFusionGPU::DeviceSaveMode() +{ + DeviceUpdateMode(); + rgb_fusion->Save(); +} \ No newline at end of file diff --git a/Controllers/GigabyteRGBFusionGPUController/RGBController_GigabyteRGBFusionGPU.h b/Controllers/GigabyteRGBFusionGPUController/RGBController_GigabyteRGBFusionGPU.h index d08ee85c..346f6298 100644 --- a/Controllers/GigabyteRGBFusionGPUController/RGBController_GigabyteRGBFusionGPU.h +++ b/Controllers/GigabyteRGBFusionGPUController/RGBController_GigabyteRGBFusionGPU.h @@ -28,7 +28,8 @@ public: void SetCustomMode(); void DeviceUpdateMode(); - + void DeviceSaveMode(); + private: RGBFusionGPUController* rgb_fusion; };