mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-21 13:38:20 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -10,34 +10,25 @@
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "DetectionManager.h"
|
||||
#include "PNYGPUController.h"
|
||||
#include "RGBController_PNYGPU.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "pci_ids.h"
|
||||
#include "PNYGPUController.h"
|
||||
#include "RGBController_PNYGPU.h"
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectPNYGPUControllers *
|
||||
* *
|
||||
* Detect PNY GPU controllers on the enumerated I2C busses at address 0x49. *
|
||||
* *
|
||||
* bus - pointer to i2c_smbus_interface where PNY GPU device is connected *
|
||||
* dev - I2C address of PNY GPU device *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectPNYGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const std::string& name)
|
||||
DetectedControllers DetectPNYGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const std::string& name)
|
||||
{
|
||||
if(bus->port_id != 1)
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
if(bus->port_id == 1)
|
||||
{
|
||||
return;
|
||||
PNYGPUController* controller = new PNYGPUController(bus, i2c_addr, name);
|
||||
RGBController_PNYGPU* rgb_controller = new RGBController_PNYGPU(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
PNYGPUController* controller = new PNYGPUController(bus, i2c_addr, name);
|
||||
RGBController_PNYGPU* rgb_controller = new RGBController_PNYGPU(controller);
|
||||
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
} /* DetectPNYGPUControllers() */
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 2060 XLR8 OC EDITION", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX2060_TU104_DEV, PNY_SUB_VEN, PNY_RTX_2060_XLR8_OC_SUB_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 3060 XLR8 Revel EPIC-X", DetectPNYGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_DEV, PNY_SUB_VEN, PNY_RTX_3060_XLR8_REVEL_EPIC_X_SUB_DEV, 0x49);
|
||||
|
||||
Reference in New Issue
Block a user