mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Fix LedDeviceLpd8806
This commit is contained in:
@@ -24,38 +24,6 @@ bool LedDeviceLpd8806::init(const QJsonObject &deviceConfig)
|
||||
return isInitOK;
|
||||
}
|
||||
|
||||
int LedDeviceLpd8806::open()
|
||||
{
|
||||
int retval = -1;
|
||||
QString errortext;
|
||||
_deviceReady = false;
|
||||
|
||||
// General initialisation and configuration of LedDevice
|
||||
if ( init(_devConfig) )
|
||||
{
|
||||
// Perform an initial reset to start accepting data on the first led
|
||||
|
||||
const unsigned clearSize = _ledCount/32+1;
|
||||
if ( writeBytes(clearSize, _ledBuffer.data()) < 0 )
|
||||
{
|
||||
errortext = QString ("Failed to do initial write");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Everything is OK -> enable device
|
||||
_deviceReady = true;
|
||||
setEnable(true);
|
||||
retval = 0;
|
||||
}
|
||||
// On error/exceptions, set LedDevice in error
|
||||
if ( retval < 0 )
|
||||
{
|
||||
this->setInError( errortext );
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int LedDeviceLpd8806::write(const std::vector<ColorRgb> &ledValues)
|
||||
{
|
||||
// Copy the colors from the ColorRgb vector to the Ldp8806 data vector
|
||||
|
Reference in New Issue
Block a user