mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
update adalight sketch (#299)
* rename platform rpi-pwm to rpi. remove original rpi platform install symlink to bin folder create effects folder for custom effects * fix osx jobs evaluation * - add rewrite time to serial leds - rework adalight sketch * add analog output * adalight: add analog mode: last led * tune adalight sketch to final state move refresh code to leddevice base class, so every leddevice can use it
This commit is contained in:
@@ -17,9 +17,14 @@ LedDevice::LedDevice()
|
||||
, _log(Logger::getInstance("LedDevice"))
|
||||
, _ledBuffer(0)
|
||||
, _deviceReady(true)
|
||||
|
||||
, _refresh_timer()
|
||||
{
|
||||
LedDevice::getLedDeviceSchemas();
|
||||
|
||||
// setup timer
|
||||
_refresh_timer.setSingleShot(false);
|
||||
_refresh_timer.setInterval(0);
|
||||
connect(&_refresh_timer, SIGNAL(timeout()), this, SLOT(rewriteLeds()));
|
||||
}
|
||||
|
||||
// dummy implemention
|
||||
@@ -103,7 +108,17 @@ QJsonObject LedDevice::getLedDeviceSchemas()
|
||||
|
||||
int LedDevice::setLedValues(const std::vector<ColorRgb>& ledValues)
|
||||
{
|
||||
return _deviceReady ? write(ledValues) : -1;
|
||||
if (!_deviceReady)
|
||||
return -1;
|
||||
|
||||
_ledValues = ledValues;
|
||||
|
||||
// restart the timer
|
||||
if (_refresh_timer.interval() > 0)
|
||||
{
|
||||
_refresh_timer.start();
|
||||
}
|
||||
return write(ledValues);
|
||||
}
|
||||
|
||||
int LedDevice::switchOff()
|
||||
@@ -118,3 +133,8 @@ void LedDevice::setLedCount(int ledCount)
|
||||
_ledRGBCount = _ledCount * sizeof(ColorRgb);
|
||||
_ledRGBWCount = _ledCount * sizeof(ColorRgbw);
|
||||
}
|
||||
|
||||
int LedDevice::rewriteLeds()
|
||||
{
|
||||
return write(_ledValues);
|
||||
}
|
||||
|
Reference in New Issue
Block a user