mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-24 22:45:55 -04:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -16,15 +16,8 @@
|
||||
#include "pci_ids.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
#define PATRIOT_CONTROLLER_NAME "Patriot Viper Steel"
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* TestForPatriotViperSteelController *
|
||||
* *
|
||||
* Tests the given address to see if a Patriot Viper Steel controller exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
#define PATRIOT_CONTROLLER_NAME "Patriot Viper Steel"
|
||||
|
||||
bool TestForPatriotViperSteelController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
@@ -40,26 +33,16 @@ bool TestForPatriotViperSteelController(i2c_smbus_interface* bus, unsigned char
|
||||
}
|
||||
|
||||
return(pass);
|
||||
}
|
||||
|
||||
} /* TestForPatriotViperSteelController() */
|
||||
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectPatriotViperSteelControllers *
|
||||
* *
|
||||
* Detect Patriot Viper Steel RGB controllers on the enumerated I2C busses. *
|
||||
* *
|
||||
* bus - pointer to i2c_smbus_interface where Aura device is connected *
|
||||
* dev - I2C address of Aura device *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectPatriotViperSteelControllers(i2c_smbus_interface* bus, std::vector<SPDWrapper*> &slots, const std::string &/*name*/)
|
||||
DetectedControllers DetectPatriotViperSteelControllers(i2c_smbus_interface* bus, std::vector<SPDWrapper*> &slots, const std::string &/*name*/)
|
||||
{
|
||||
unsigned char slots_valid = 0x00;
|
||||
DetectedControllers detected_controllers;
|
||||
unsigned char slots_valid = 0x00;
|
||||
|
||||
// Check for Patriot Viper controller at 0x77
|
||||
/*-----------------------------------------------------*\
|
||||
| Check for Patriot Viper controller at 0x77 |
|
||||
\*-----------------------------------------------------*/
|
||||
LOG_DEBUG("[%s] Testing bus %d at address 0x77", PATRIOT_CONTROLLER_NAME, bus->port_id);
|
||||
|
||||
if(TestForPatriotViperSteelController(bus, 0x77))
|
||||
@@ -84,11 +67,13 @@ void DetectPatriotViperSteelControllers(i2c_smbus_interface* bus, std::vector<SP
|
||||
{
|
||||
PatriotViperSteelController* controller = new PatriotViperSteelController(bus, 0x77);
|
||||
RGBController_PatriotViperSteel* rgb_controller = new RGBController_PatriotViperSteel(controller);
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectPatriotViperSteelControllers() */
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_DRAM_DETECTOR(PATRIOT_CONTROLLER_NAME, DetectPatriotViperSteelControllers, 0xFF7E, SPD_DDR4_SDRAM);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user