Fix LedDeviceLpd8806

This commit is contained in:
LordGrey 2020-06-11 23:10:22 +02:00
parent 244b4e6886
commit 7d354aa72d
2 changed files with 0 additions and 40 deletions

View File

@ -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

View File

@ -95,14 +95,6 @@ public:
/// @return true if success
virtual bool init(const QJsonObject &deviceConfig) override;
protected:
///
/// Opens and initiatialises the output device
///
/// @return Zero on succes (i.e. device is ready and enabled) else negative
///
virtual int open() override;
private:
///
/// Writes the led color values to the led-device