mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-28 17:01:09 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -22,15 +22,6 @@
|
||||
#define VENDOR_NAME "Gigabyte Technology Co., Ltd."
|
||||
#define SMBUS_ADDRESS 0x28
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* TestForGigabyteRGBFusionController *
|
||||
* *
|
||||
* Tests the given address to see if an RGB Fusion controller exists there. First *
|
||||
* does a quick write to test for a response *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
bool TestForGigabyteRGBFusionController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
bool pass = false;
|
||||
@@ -50,22 +41,12 @@ bool TestForGigabyteRGBFusionController(i2c_smbus_interface* bus, unsigned char
|
||||
}
|
||||
|
||||
return(pass);
|
||||
}
|
||||
|
||||
} /* TestForGigabyteRGBFusionController() */
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectGigabyteRGBFusionControllers *
|
||||
* *
|
||||
* Detect RGB Fusion controllers on the enumerated I2C busses at address 0x28. *
|
||||
* *
|
||||
* bus - pointer to i2c_smbus_interface where RGB Fusion device is connected *
|
||||
* dev - I2C address of RGB Fusion device *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectGigabyteRGBFusionControllers(std::vector<i2c_smbus_interface*>& busses)
|
||||
DetectedControllers DetectGigabyteRGBFusionControllers(std::vector<i2c_smbus_interface*>& busses)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
for(unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
{
|
||||
IF_MOBO_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
|
||||
@@ -74,13 +55,15 @@ void DetectGigabyteRGBFusionControllers(std::vector<i2c_smbus_interface*>& busse
|
||||
{
|
||||
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
|
||||
|
||||
// Check for RGB Fusion controller at 0x28
|
||||
/*-----------------------------------------*\
|
||||
| Check for RGB Fusion controller at 0x28 |
|
||||
\*-----------------------------------------*/
|
||||
if(TestForGigabyteRGBFusionController(busses[bus], SMBUS_ADDRESS))
|
||||
{
|
||||
RGBFusionController* controller = new RGBFusionController(busses[bus], SMBUS_ADDRESS);
|
||||
RGBController_RGBFusion* rgb_controller = new RGBController_RGBFusion(controller);
|
||||
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -89,6 +72,8 @@ void DetectGigabyteRGBFusionControllers(std::vector<i2c_smbus_interface*>& busse
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectGigabyteRGBFusionControllers() */
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_DETECTOR("Gigabyte RGB Fusion", DetectGigabyteRGBFusionControllers);
|
||||
|
||||
Reference in New Issue
Block a user