mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-02 12:17:51 -05:00
+ Adding layout for Z390 AORUS MASTER-CF + Adding destructor to RGBController_GigabyteRGBFusion2USB.cpp to 'delete controller' + Allows custom layout saving to config + Custom config will save out to config if not present + Layout is enablable and disabled by default + Added a lookup map from mapping in config + Added a template for the reverse_map for saving to the config + Removed the header integers from the config to avoid invalid values + Changed internal mapping closer to JSON for ease of lookup + Added protection to the led count + Added calibration to config * Disabled execution of calibration until explicitely enabled in config Commit amended for code style of changes as well as general cleanup of RGB Fusion 2 USB controller by Adam Honse <calcprogrammer1@gmail.com>
41 lines
2.0 KiB
C++
41 lines
2.0 KiB
C++
#include "Detector.h"
|
|
#include "GigabyteRGBFusion2USBController.h"
|
|
#include "RGBController_GigabyteRGBFusion2USB.h"
|
|
#include "dependencies/dmiinfo.h"
|
|
#define DETECTOR_NAME "Gigabyte RGB Fusion 2 USB"
|
|
|
|
#define IT8297_VID 0x048D
|
|
#define IT8297_IFC 0
|
|
#define IT8297_U 0xCC
|
|
#define IT8297_UPG 0xFF89
|
|
|
|
/******************************************************************************************\
|
|
* *
|
|
* DetectGigabyteRGBFusion2USBControllers *
|
|
* *
|
|
* Detect GigabyteRGB Fusion 2 devices that use IT8297 RGB controller *
|
|
* *
|
|
\******************************************************************************************/
|
|
|
|
void DetectGigabyteRGBFusion2USBControllers(hid_device_info* info, const std::string&)
|
|
{
|
|
DMIInfo MB_info;
|
|
hid_device* dev = hid_open_path(info->path);
|
|
if (dev)
|
|
{
|
|
RGBFusion2USBController * controller = new RGBFusion2USBController(dev, info->path, MB_info.getMainboard());
|
|
RGBController_RGBFusion2USB * rgb_controller = new RGBController_RGBFusion2USB(controller, DETECTOR_NAME);
|
|
// Constructor sets the name
|
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
|
}
|
|
} /* DetectRGBFusion2USBControllers() */
|
|
|
|
#ifdef USE_HID_USAGE
|
|
REGISTER_HID_DETECTOR_PU(DETECTOR_NAME, DetectGigabyteRGBFusion2USBControllers, IT8297_VID, 0x8297, IT8297_UPG, IT8297_U);
|
|
REGISTER_HID_DETECTOR_PU(DETECTOR_NAME, DetectGigabyteRGBFusion2USBControllers, IT8297_VID, 0x5702, IT8297_UPG, IT8297_U);
|
|
#else
|
|
REGISTER_HID_DETECTOR_I(DETECTOR_NAME, DetectGigabyteRGBFusion2USBControllers, IT8297_VID, 0x8297, IT8297_IFC);
|
|
REGISTER_HID_DETECTOR_I(DETECTOR_NAME, DetectGigabyteRGBFusion2USBControllers, IT8297_VID, 0x5702, IT8297_IFC);
|
|
#endif
|
|
|