From 7d38cd4a78cc877b08d13dff534810432ec4c197 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 26 Jun 2020 03:04:29 +1000 Subject: [PATCH] Fix issue #161 - removed added LED in known_channels for the x570 - ensured that the .header address is passed to SetLEDEffect() correctly --- RGBController/RGBController_RGBFusion2USB.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/RGBController/RGBController_RGBFusion2USB.cpp b/RGBController/RGBController_RGBFusion2USB.cpp index 13129456..bc2e9f1a 100644 --- a/RGBController/RGBController_RGBFusion2USB.cpp +++ b/RGBController/RGBController_RGBFusion2USB.cpp @@ -58,7 +58,6 @@ static const KnownChannels known_channels { "Back I/O", HDR_BACK_IO }, { "CPU", HDR_CPU }, { "PCIe", HDR_PCIE }, - { "LED 2", HDR_LED_2}, // Unique to WiFi models? { "LED C1/C2", HDR_LED_C1C2 }, // 12VGRB headers seem to be connected }, // Zone 1 @@ -417,10 +416,6 @@ void RGBController_RGBFusion2USB::UpdateSingleLED(int led) KnownChannels::const_iterator it = known_channels.find(controller->GetDeviceName()); - if (it == known_channels.end() || it->second.size() == 0) - { - led = it->second[ZONE_MB][led].header; - } /*---------------------------------------------------------*\ | Motherboard LEDs always use effect mode, so use static for| @@ -444,6 +439,12 @@ void RGBController_RGBFusion2USB::UpdateSingleLED(int led) blu = RGBGetBValue(modes[active_mode].colors[0]); } + //LED lookup needs to be done after it's used as an index + if (it->second.size() > 0) + { + led = it->second[ZONE_MB][led].header; + } + controller->SetLEDEffect(led, mode_value, modes[active_mode].speed, random, red, grn, blu); controller->ApplyEffect(); }