From 52f12b4ec9753f0b00ddeeb98d709b15b55a0444 Mon Sep 17 00:00:00 2001 From: Awawa <69086569+awawa-dev@users.noreply.github.com> Date: Sun, 24 Mar 2024 00:17:43 +0100 Subject: [PATCH] Close LED device on correct Thread (#803) --- sources/leddevice/LedDeviceWrapper.cpp | 2 +- sources/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp | 2 +- sources/leddevice/dev_serial/ProviderSerial.cpp | 2 +- sources/leddevice/dev_spi/ProviderSpi.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/leddevice/LedDeviceWrapper.cpp b/sources/leddevice/LedDeviceWrapper.cpp index 06e52b8b1..292421af1 100644 --- a/sources/leddevice/LedDeviceWrapper.cpp +++ b/sources/leddevice/LedDeviceWrapper.cpp @@ -56,7 +56,7 @@ void LedDeviceWrapper::createLedDevice(QJsonObject config, int smoothingInterval _ledDevice = std::unique_ptr( LedDeviceFactory::construct(config), [](LedDevice* oldLed) { - oldLed->stop(); + QUEUE_CALL_0(oldLed, stop); hyperhdr::THREAD_REMOVER(QString("LedDevice"), oldLed->thread(), oldLed); } ); diff --git a/sources/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp b/sources/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp index 11afe742b..62a8b8304 100644 --- a/sources/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp +++ b/sources/leddevice/dev_rpi_pwm/LedDeviceWS281x.cpp @@ -69,7 +69,7 @@ bool LedDeviceWS281x::init(const QJsonObject& deviceConfig) Debug(_log, "ws281x strip type : %d", _ledString->channel[_channel].strip_type); if (_defaultInterval > 0) - Error(_log, "The refresh timer is enabled ('Refresh time' > 0) and may limit the performance of the LED driver. Ignore this error if you set it on purpose for some reason (but you almost never need it)."); + Warning(_log, "The refresh timer is enabled ('Refresh time' > 0) and may limit the performance of the LED driver. Ignore this error if you set it on purpose for some reason (but you almost never need it)."); isInitOK = true; } diff --git a/sources/leddevice/dev_serial/ProviderSerial.cpp b/sources/leddevice/dev_serial/ProviderSerial.cpp index 014f34661..743ec4919 100644 --- a/sources/leddevice/dev_serial/ProviderSerial.cpp +++ b/sources/leddevice/dev_serial/ProviderSerial.cpp @@ -73,7 +73,7 @@ bool ProviderSerial::init(const QJsonObject& deviceConfig) Debug(_log, "Retry limit : %d", _maxRetry); if (_defaultInterval > 0) - Error(_log, "The refresh timer is enabled ('Refresh time' > 0) and may limit the performance of the LED driver. Ignore this error if you set it on purpose for some reason (but you almost never need it)."); + Warning(_log, "The refresh timer is enabled ('Refresh time' > 0) and may limit the performance of the LED driver. Ignore this error if you set it on purpose for some reason (but you almost never need it)."); isInitOK = true; } diff --git a/sources/leddevice/dev_spi/ProviderSpi.cpp b/sources/leddevice/dev_spi/ProviderSpi.cpp index df74e9561..090d1cd9c 100644 --- a/sources/leddevice/dev_spi/ProviderSpi.cpp +++ b/sources/leddevice/dev_spi/ProviderSpi.cpp @@ -53,7 +53,7 @@ bool ProviderSpi::init(const QJsonObject& deviceConfig) Debug(_log, "Inverted: %s, Mode: %d", (_spiDataInvert) ? "yes" : "no", _spiMode); if (_defaultInterval > 0) - Error(_log, "The refresh timer is enabled ('Refresh time' > 0) and may limit the performance of the LED driver. Ignore this error if you set it on purpose for some reason (but you almost never need it)."); + Warning(_log, "The refresh timer is enabled ('Refresh time' > 0) and may limit the performance of the LED driver. Ignore this error if you set it on purpose for some reason (but you almost never need it)."); isInitOK = true; }