diff --git a/Controllers/ENESMBusController/ENESMBusController.cpp b/Controllers/ENESMBusController/ENESMBusController.cpp index 11b70965b..d76394655 100644 --- a/Controllers/ENESMBusController/ENESMBusController.cpp +++ b/Controllers/ENESMBusController/ENESMBusController.cpp @@ -31,8 +31,9 @@ static const char* ene_channels[] = /* ENE channel strings ENESMBusController::ENESMBusController(ENESMBusInterface* interface, ene_dev_id dev) { - this->interface = interface; - this->dev = dev; + this->interface = interface; + this->dev = dev; + supports_mode_14 = false; UpdateDeviceName(); @@ -93,6 +94,17 @@ ENESMBusController::ENESMBusController(ENESMBusInterface* interface, ene_dev_id direct_reg = ENE_REG_COLORS_DIRECT_V2; effect_reg = ENE_REG_COLORS_EFFECT_V2; channel_cfg = ENE_CONFIG_CHANNEL_V1; + + // Check for Mode 14 support, only known to exist on modules where the + // DRAM 3 zone ID exists + for(std::size_t cfg_zone_idx = 0; cfg_zone_idx < ENE_NUM_ZONES; cfg_zone_idx++) + { + if(config_table[channel_cfg + cfg_zone_idx] == (unsigned char)ENE_LED_CHANNEL_DRAM_3) + { + supports_mode_14 = true; + break; + } + } } // AUMA0-E6K5-0106 - Second generation motherboard controller else if (strcmp(device_name, "AUMA0-E6K5-0106") == 0) @@ -371,6 +383,11 @@ void ENESMBusController::SetMode(unsigned char mode, unsigned char speed, unsign ENERegisterWrite(ENE_REG_APPLY, ENE_APPLY_VAL); } +bool ENESMBusController::SupportsMode14() +{ + return(supports_mode_14); +} + void ENESMBusController::UpdateDeviceName() { for (int i = 0; i < 16; i++) diff --git a/Controllers/ENESMBusController/ENESMBusController.h b/Controllers/ENESMBusController/ENESMBusController.h index 6de6bc8b6..035146fd6 100644 --- a/Controllers/ENESMBusController/ENESMBusController.h +++ b/Controllers/ENESMBusController/ENESMBusController.h @@ -120,6 +120,7 @@ class ENESMBusController void SetLEDColorDirect(unsigned int led, unsigned char red, unsigned char green, unsigned char blue); void SetLEDColorEffect(unsigned int led, unsigned char red, unsigned char green, unsigned char blue); void SetMode(unsigned char mode, unsigned char speed, unsigned char direction); + bool SupportsMode14(); void UpdateDeviceName(); @@ -136,4 +137,5 @@ class ENESMBusController unsigned char channel_cfg; ENESMBusInterface* interface; ene_dev_id dev; + bool supports_mode_14; }; diff --git a/Controllers/ENESMBusController/RGBController_ENESMBus.cpp b/Controllers/ENESMBusController/RGBController_ENESMBus.cpp index b4890ba2d..8858a3587 100644 --- a/Controllers/ENESMBusController/RGBController_ENESMBus.cpp +++ b/Controllers/ENESMBusController/RGBController_ENESMBus.cpp @@ -159,7 +159,7 @@ RGBController_ENESMBus::RGBController_ENESMBus(ENESMBusController * controller_p RandomFlicker.speed = ENE_SPEED_NORMAL; modes.push_back(RandomFlicker); - if(version == "AUDA0-E6K5-0101") + if(controller->SupportsMode14()) { mode DoubleFade; DoubleFade.name = "Double Fade";