diff --git a/usermods/Temperature/usermod_temperature.h b/usermods/Temperature/usermod_temperature.h index af509a67..ad55b49e 100644 --- a/usermods/Temperature/usermod_temperature.h +++ b/usermods/Temperature/usermod_temperature.h @@ -81,7 +81,9 @@ class UsermodTemperature : public Usermod { temperature = readDallas(); lastMeasurement = millis(); waitingForConversion = false; - DEBUG_PRINTF("Read temperature %2.1f.\n", temperature); + //DEBUG_PRINTF("Read temperature %2.1f.\n", temperature); // does not work properly on 8266 + DEBUG_PRINT(F("Read temperature ")); + DEBUG_PRINTLN(temperature); } bool findSensor() { diff --git a/wled00/colors.cpp b/wled00/colors.cpp index 5db87326..339dd0ac 100644 --- a/wled00/colors.cpp +++ b/wled00/colors.cpp @@ -49,54 +49,46 @@ void relativeChangeWhite(int8_t amount, byte lowerBoundary) void colorHSVtoRGB(float hue, float saturation, float value, byte& red, byte& green, byte& blue) { - float r, g, b; + float r = red, g = green, b = blue; - auto i = static_cast(hue * 6); - auto f = hue * 6 - i; - auto p = value * (1 - saturation); - auto q = value * (1 - f * saturation); - auto t = value * (1 - (1 - f) * saturation); + uint8_t i = hue * 6.0; + float f = hue * 6.0 - i; + value *= 255.0; + float p = value * (1.0 - saturation); + float q = value * (1.0 - f * saturation); + float t = value * (1.0 - (1.0 - f) * saturation); - switch (i % 6) - { - case 0: r = value, g = t, b = p; - break; - case 1: r = q, g = value, b = p; - break; - case 2: r = p, g = value, b = t; - break; - case 3: r = p, g = q, b = value; - break; - case 4: r = t, g = p, b = value; - break; - case 5: r = value, g = p, b = q; - break; + switch (i % 6) { + case 0: r = value, g = t, b = p; break; + case 1: r = q, g = value, b = p; break; + case 2: r = p, g = value, b = t; break; + case 3: r = p, g = q, b = value; break; + case 4: r = t, g = p, b = value; break; + case 5: r = value, g = p, b = q; break; } - red = static_cast(r * 255); - green = static_cast(g * 255); - blue = static_cast(b * 255); + red = r; + green = g; + blue = b; } void colorRGBtoHSV(byte red, byte green, byte blue, float& hue, float& saturation, float& value) { - auto rd = static_cast(red) / 255; - auto gd = static_cast(green) / 255; - auto bd = static_cast(blue) / 255; - auto max = std::max({ rd, gd, bd }), min = std::min({ rd, gd, bd }); + float rd = red/255.0, gd = green/255.0, bd = blue/255.0; + float max = std::max({ rd, gd, bd }), min = std::min({ rd, gd, bd }); value = max; - auto d = max - min; - saturation = max == 0 ? 0 : d / max; + float d = max - min; + saturation = max == 0.0 ? 0.0 : d / max; hue = 0; if (max != min) { - if (max == rd) hue = (gd - bd) / d + (gd < bd ? 6 : 0); - else if (max == gd) hue = (bd - rd) / d + 2; - else if (max == bd) hue = (rd - gd) / d + 4; - hue /= 6; + if (max == rd) hue = (gd - bd) / d + (gd < bd ? 6.0 : 0.0); + else if (max == gd) hue = (bd - rd) / d + 2.0; + else if (max == bd) hue = (rd - gd) / d + 4.0; + hue /= 6.0; } } diff --git a/wled00/data/index.js b/wled00/data/index.js index cb1dcc54..2e6dbd20 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -805,7 +805,7 @@ function populateEffects() effects.unshift({ "id": 0, - "name": "Solid", + "name": "Solid" }); for (let i = 0; i < effects.length; i++) { diff --git a/wled00/json.cpp b/wled00/json.cpp index 00158c85..e6ce3a7e 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -169,16 +169,16 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId) strip.fill(0); } - uint16_t start = 0, stop = 0; + //uint16_t start = 0, stop = 0; byte set = 0; //0 nothing set, 1 start set, 2 range set for (uint16_t i = 0; i < iarr.size(); i++) { if(iarr[i].is()) { if (!set) { - start = iarr[i]; + //start = iarr[i]; set = 1; } else { - stop = iarr[i]; + //stop = iarr[i]; set = 2; } } else { //color diff --git a/wled00/wled.h b/wled00/wled.h index 8b7444e9..5db45ba9 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2108231 +#define VERSION 2108241 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG