Retrive motherboard DMI name info and use it

This commit is contained in:
TheRogueZeta 2020-12-02 19:26:59 -08:00 committed by Adam Honse
parent 3f7c981ba2
commit c030157ffb
2 changed files with 12 additions and 4 deletions

View file

@ -9,6 +9,7 @@
#include "ASRockPolychromeSMBusController.h"
#include <cstring>
#include "dependencies/dmiinfo.h"
using namespace std::chrono_literals;
@ -17,6 +18,8 @@ PolychromeController::PolychromeController(i2c_smbus_interface* bus, polychrome_
this->bus = bus;
this->dev = dev;
DMIInfo dmi;
unsigned short fw_version = ReadFirmwareVersion();
unsigned char major_version = fw_version >> 8;
@ -29,19 +32,19 @@ PolychromeController::PolychromeController(i2c_smbus_interface* bus, polychrome_
switch(major_version)
{
case ASROCK_TYPE_ASRLED:
device_name = "ASRock ASR LED";
device_name = "ASRock " + dmi.getMainboard();
asrock_type = ASROCK_TYPE_ASRLED;
memset(zone_led_count, 0, sizeof(zone_led_count));
break;
case ASROCK_TYPE_POLYCHROME_V1:
device_name = "ASRock Polychrome V1";
device_name = "ASRock " + dmi.getMainboard();
asrock_type = ASROCK_TYPE_POLYCHROME_V1;
ReadLEDConfiguration();
break;
case ASROCK_TYPE_POLYCHROME_V2:
device_name = "ASRock Polychrome V2";
device_name = "ASRock " + dmi.getMainboard();
asrock_type = ASROCK_TYPE_POLYCHROME_V2;
ReadLEDConfiguration();
break;

View file

@ -40,13 +40,14 @@ RGBController_Polychrome::RGBController_Polychrome(PolychromeController* polychr
vendor = "ASRock";
version = polychrome->GetFirmwareVersion();
type = DEVICE_TYPE_MOTHERBOARD;
description = "ASRock ASR LED/Polychrome Device";
location = polychrome->GetDeviceLocation();
switch(polychrome->GetASRockType())
{
case ASROCK_TYPE_ASRLED:
{
description = "ASRock ASR LED Device";
mode Off;
Off.name = "Off";
Off.value = ASRLED_MODE_OFF;
@ -122,6 +123,8 @@ RGBController_Polychrome::RGBController_Polychrome(PolychromeController* polychr
case ASROCK_TYPE_POLYCHROME_V1:
{
description = "ASRock Polychrome v1 Device";
mode Off;
Off.name = "Off";
Off.value = POLYCHROME_V1_MODE_OFF;
@ -270,6 +273,8 @@ RGBController_Polychrome::RGBController_Polychrome(PolychromeController* polychr
case ASROCK_TYPE_POLYCHROME_V2:
{
description = "ASRock Polychrome v2 Device";
mode Off;
Off.name = "Off";
Off.value = POLYCHROME_V2_MODE_OFF;