Store name in PNYLovelaceGPUController to avoid setting it in detector
This commit is contained in:
parent
67e08d3415
commit
2134323bf8
4 changed files with 22 additions and 14 deletions
|
|
@ -11,10 +11,11 @@
|
||||||
|
|
||||||
#include "PNYLovelaceGPUController.h"
|
#include "PNYLovelaceGPUController.h"
|
||||||
|
|
||||||
PNYLovelaceGPUController::PNYLovelaceGPUController(i2c_smbus_interface* bus, pny_dev_id dev)
|
PNYLovelaceGPUController::PNYLovelaceGPUController(i2c_smbus_interface* bus, pny_dev_id dev, std::string dev_name)
|
||||||
{
|
{
|
||||||
this->bus = bus;
|
this->bus = bus;
|
||||||
this->dev = dev;
|
this->dev = dev;
|
||||||
|
this->name = dev_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
PNYLovelaceGPUController::~PNYLovelaceGPUController()
|
PNYLovelaceGPUController::~PNYLovelaceGPUController()
|
||||||
|
|
@ -32,6 +33,11 @@ std::string PNYLovelaceGPUController::GetDeviceLocation()
|
||||||
return("I2C: " + return_string);
|
return("I2C: " + return_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string PNYLovelaceGPUController::GetDeviceName()
|
||||||
|
{
|
||||||
|
return(name);
|
||||||
|
}
|
||||||
|
|
||||||
void PNYLovelaceGPUController::SetOff()
|
void PNYLovelaceGPUController::SetOff()
|
||||||
{
|
{
|
||||||
unsigned char data[7] = {};
|
unsigned char data[7] = {};
|
||||||
|
|
|
||||||
|
|
@ -34,19 +34,22 @@ enum
|
||||||
class PNYLovelaceGPUController
|
class PNYLovelaceGPUController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PNYLovelaceGPUController(i2c_smbus_interface* bus, pny_dev_id dev);
|
PNYLovelaceGPUController(i2c_smbus_interface* bus, pny_dev_id dev, std::string dev_name);
|
||||||
~PNYLovelaceGPUController();
|
~PNYLovelaceGPUController();
|
||||||
|
|
||||||
std::string GetDeviceLocation();
|
std::string GetDeviceLocation();
|
||||||
void SetOff();
|
std::string GetDeviceName();
|
||||||
void SetBreath(unsigned char speed, unsigned char red, unsigned char green, unsigned char blue);
|
|
||||||
void SetCycle(unsigned char speed, unsigned char brightness);
|
void SetOff();
|
||||||
void SetWave(unsigned char speed, unsigned char brightness);
|
void SetBreath(unsigned char speed, unsigned char red, unsigned char green, unsigned char blue);
|
||||||
void SetFlash(unsigned char speed, unsigned char brightness, unsigned char red, unsigned char green, unsigned char blue);
|
void SetCycle(unsigned char speed, unsigned char brightness);
|
||||||
void SetDirect(unsigned char led, unsigned char red, unsigned char green, unsigned char blue);
|
void SetWave(unsigned char speed, unsigned char brightness);
|
||||||
|
void SetFlash(unsigned char speed, unsigned char brightness, unsigned char red, unsigned char green, unsigned char blue);
|
||||||
|
void SetDirect(unsigned char led, unsigned char red, unsigned char green, unsigned char blue);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
i2c_smbus_interface* bus;
|
i2c_smbus_interface* bus;
|
||||||
pny_dev_id dev;
|
pny_dev_id dev;
|
||||||
|
std::string name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,8 @@ void DetectPNYLovelaceGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PNYLovelaceGPUController* controller = new PNYLovelaceGPUController(bus, i2c_addr);
|
PNYLovelaceGPUController* controller = new PNYLovelaceGPUController(bus, i2c_addr, name);
|
||||||
RGBController_PNYLovelaceGPU* rgb_controller = new RGBController_PNYLovelaceGPU(controller);
|
RGBController_PNYLovelaceGPU* rgb_controller = new RGBController_PNYLovelaceGPU(controller);
|
||||||
rgb_controller->name = name;
|
|
||||||
|
|
||||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||||
} /* DetectPNYLovelaceGPUControllers() */
|
} /* DetectPNYLovelaceGPUControllers() */
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ RGBController_PNYLovelaceGPU::RGBController_PNYLovelaceGPU(PNYLovelaceGPUControl
|
||||||
{
|
{
|
||||||
controller = controller_ptr;
|
controller = controller_ptr;
|
||||||
|
|
||||||
name = "PNY GPU";
|
name = controller->GetDeviceName();
|
||||||
vendor = "PNY";
|
vendor = "PNY";
|
||||||
description = "PNY RGB GPU Device";
|
description = "PNY RGB GPU Device";
|
||||||
location = controller->GetDeviceLocation();
|
location = controller->GetDeviceLocation();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue