From a3e0e70aecea3b02a0092d0d9cdde424f8c1d17d Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Sat, 9 Nov 2019 01:50:02 +0300 Subject: [PATCH] HSV -> RGB translation for Adafruit fixed (OMG!) RGB volume restoring issue fixed AirFlow regulator action timer more precsision --- lighthub/item.cpp | 8 ++++---- lighthub/modules/out_motor.cpp | 8 ++++---- lighthub/modules/out_spiled.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 61975d7..0e9f439 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -722,12 +722,12 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode switch (itemType) { case CH_DIMMER: case CH_MODBUS: - if (st.aslong> 16)& 0xFF); DmxWrite(iaddr + 1, (rgb >> 8) & 0xFF); DmxWrite(iaddr + 2, rgb & 0xFF); @@ -1548,7 +1548,7 @@ switch (cause) void Item::sendDelayedStatus() { long int flags = getFlag(SEND_COMMAND | SEND_PARAMETERS); - debugSerial<name<name<0 && !st) item->setCmd(CMD_OFF); if (chActive==0 && st) item->setCmd(CMD_ON); item->SendStatus(SEND_COMMAND | SEND_PARAMETERS | SEND_DEFFERED); - item->setExt(millis()+maxOnTime); //Extend motor time + if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time } else item->SendStatus(SEND_PARAMETERS | SEND_DEFFERED); @@ -211,7 +211,7 @@ case S_CMD: st = item->getVal(); - if (st && (stsetVal(st); if (st) //Stored smthng @@ -227,12 +227,12 @@ case S_CMD: item->setVal(st); if (send) item->SendStatus(SEND_COMMAND | SEND_PARAMETERS ); } - item->setExt(millis()+maxOnTime); //Extend motor time + if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time return 1; case CMD_OFF: if (send) item->SendStatus(SEND_COMMAND); - item->setExt(millis()+maxOnTime); //Extend motor time + if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time return 1; } //switch cmd diff --git a/lighthub/modules/out_spiled.cpp b/lighthub/modules/out_spiled.cpp index 5bd8a61..553155a 100644 --- a/lighthub/modules/out_spiled.cpp +++ b/lighthub/modules/out_spiled.cpp @@ -121,7 +121,7 @@ CRGB pixel; int Value = map(st->v, 0, 100, 0, 255); #ifdef ADAFRUIT_LED - uint16_t Hue = map(st->h, 0, 365, 0, 655535); + uint16_t Hue = map(st->h, 0, 365, 0, 65535); pixel = leds->ColorHSV(Hue, Saturation, Value); #else int Hue = map(st->h, 0, 365, 0, 255); @@ -287,7 +287,7 @@ case S_CMD: PixelCtrl(&st,CMD_ON,from,to); else //whole strip { - if (st.aslong && (st.vsetVal(st.aslong); if (st.aslong ) //Stored smthng