mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Merge branch 'Beta' of https://github.com/hyperion-project/hyperion into Beta
Former-commit-id: 7e6f328f5cd1912374fb25a5676e07b9e44630be
This commit is contained in:
commit
13b08d5df1
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -3,4 +3,4 @@
|
||||
url = https://github.com/tvdzwan/protobuf.git
|
||||
[submodule "dependencies/external/rpi_ws281x"]
|
||||
path = dependencies/external/rpi_ws281x
|
||||
url = https://github.com/jgarff/rpi_ws281x
|
||||
url = https://github.com/penfold42/rpi_ws281x
|
||||
|
2
dependencies/external/rpi_ws281x
vendored
2
dependencies/external/rpi_ws281x
vendored
@ -1 +1 @@
|
||||
Subproject commit 0165896aa04b08a777fb6732a1af6fa29e4a93c5
|
||||
Subproject commit dfcf740848898b432fe3a3170417de60f81521ee
|
@ -480,7 +480,7 @@ RgbChannelCorrection* Hyperion::createRgbChannelCorrection(const Json::Value& co
|
||||
|
||||
RgbChannelAdjustment* Hyperion::createRgbChannelAdjustment(const Json::Value& colorConfig, const RgbChannel color)
|
||||
{
|
||||
int varR, varG, varB;
|
||||
int varR=0, varG=0, varB=0;
|
||||
if (color == RED)
|
||||
{
|
||||
varR = colorConfig.get("redChannel", 255).asInt();
|
||||
@ -618,10 +618,10 @@ MessageForwarder * Hyperion::getForwarder()
|
||||
Hyperion::Hyperion(const Json::Value &jsonConfig) :
|
||||
_ledString(createLedString(jsonConfig["leds"], createColorOrder(jsonConfig["device"]))),
|
||||
_muxer(_ledString.leds().size()),
|
||||
_raw2ledAdjustment(createLedColorsAdjustment(_ledString.leds().size(), jsonConfig["color"])),
|
||||
_raw2ledTransform(createLedColorsTransform(_ledString.leds().size(), jsonConfig["color"])),
|
||||
_raw2ledCorrection(createLedColorsCorrection(_ledString.leds().size(), jsonConfig["color"])),
|
||||
_raw2ledTemperature(createLedColorsTemperature(_ledString.leds().size(), jsonConfig["color"])),
|
||||
_raw2ledTransform(createLedColorsTransform(_ledString.leds().size(), jsonConfig["color"])),
|
||||
_raw2ledAdjustment(createLedColorsAdjustment(_ledString.leds().size(), jsonConfig["color"])),
|
||||
_device(LedDeviceFactory::construct(jsonConfig["device"])),
|
||||
_effectEngine(nullptr),
|
||||
_messageForwarder(createMessageForwarder(jsonConfig["forwarder"])),
|
||||
|
@ -14,7 +14,8 @@ LinearColorSmoothing::LinearColorSmoothing(
|
||||
_updateInterval(1000 / ledUpdateFrequency_hz),
|
||||
_settlingTime(settlingTime_ms),
|
||||
_timer(),
|
||||
_outputDelay(updateDelay)
|
||||
_outputDelay(updateDelay),
|
||||
_writeToLedsEnable(true)
|
||||
{
|
||||
_timer.setSingleShot(false);
|
||||
_timer.setInterval(_updateInterval);
|
||||
@ -82,9 +83,11 @@ void LinearColorSmoothing::updateLeds()
|
||||
_previousTime = now;
|
||||
|
||||
queueColors(_previousValues);
|
||||
_writeToLedsEnable = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_writeToLedsEnable = true;
|
||||
float k = 1.0f - 1.0f * deltaTime / (_targetTime - _previousTime);
|
||||
|
||||
for (size_t i = 0; i < _previousValues.size(); ++i)
|
||||
@ -107,7 +110,8 @@ void LinearColorSmoothing::queueColors(const std::vector<ColorRgb> & ledColors)
|
||||
if (_outputDelay == 0)
|
||||
{
|
||||
// No output delay => immediate write
|
||||
_ledDevice->write(ledColors);
|
||||
if ( _writeToLedsEnable )
|
||||
_ledDevice->write(ledColors);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -116,7 +120,8 @@ void LinearColorSmoothing::queueColors(const std::vector<ColorRgb> & ledColors)
|
||||
// If the delay-buffer is filled pop the front and write to device
|
||||
if (_outputQueue.size() > _outputDelay)
|
||||
{
|
||||
_ledDevice->write(_outputQueue.front());
|
||||
if ( _writeToLedsEnable )
|
||||
_ledDevice->write(_outputQueue.front());
|
||||
_outputQueue.pop_front();
|
||||
}
|
||||
}
|
||||
|
@ -80,4 +80,6 @@ private:
|
||||
/** The output queue */
|
||||
std::list<std::vector<ColorRgb> > _outputQueue;
|
||||
|
||||
// prevent sending data to device when no intput data is sent
|
||||
bool _writeToLedsEnable;
|
||||
};
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
RgbChannelCorrection::RgbChannelCorrection() :
|
||||
_correctionR(255),
|
||||
_correctionB(255),
|
||||
_correctionG(255)
|
||||
_correctionG(255),
|
||||
_correctionB(255)
|
||||
{
|
||||
initializeMapping();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user