diff --git a/wled00/led.cpp b/wled00/led.cpp index 19e376ab4..33fdef115 100644 --- a/wled00/led.cpp +++ b/wled00/led.cpp @@ -189,7 +189,7 @@ void handleTransitions() if (transitionActive && transitionDelayTemp > 0) { float tper = (millis() - transitionStartTime)/(float)transitionDelayTemp; - if (tper >= 1.0) + if (tper >= 1.0f) { strip.setTransitionMode(false); transitionActive = false; diff --git a/wled00/lx_parser.cpp b/wled00/lx_parser.cpp index 8dd47bdef..7fd91ea02 100644 --- a/wled00/lx_parser.cpp +++ b/wled00/lx_parser.cpp @@ -25,7 +25,7 @@ bool parseLx(int lxValue, byte* rgbw) float tmpBri = floor((lxValue - 200000000) / 10000); ; uint16_t ct = (lxValue - 200000000) - (((uint8_t)tmpBri) * 10000); - tmpBri *= 2.55; + tmpBri *= 2.55f; tmpBri = constrain(tmpBri, 0, 255); colorKtoRGB(ct, rgbw); diff --git a/wled00/util.cpp b/wled00/util.cpp index 5ab073e6b..1902f5cb8 100644 --- a/wled00/util.cpp +++ b/wled00/util.cpp @@ -520,7 +520,7 @@ um_data_t* simulateSound(uint8_t simulationId) maxVol = 31; // this gets feedback fro UI binNum = 8; // this gets feedback fro UI volumeRaw = volumeSmth; - my_magnitude = 10000.0 / 8.0f; //no idea if 10000 is a good value for FFT_Magnitude ??? + my_magnitude = 10000.0f / 8.0f; //no idea if 10000 is a good value for FFT_Magnitude ??? if (volumeSmth < 1 ) my_magnitude = 0.001f; // noise gate closed - mute return um_data; diff --git a/wled00/wled_math.cpp b/wled00/wled_math.cpp index ed698a5cd..a4c9fc123 100644 --- a/wled00/wled_math.cpp +++ b/wled00/wled_math.cpp @@ -41,7 +41,7 @@ float sin_t(float x) { float tan_t(float x) { float c = cos_t(x); - if (c==0.0) return 0; + if (c==0.0f) return 0; float res = sin_t(x) / c; #ifdef WLED_DEBUG_MATH Serial.printf("tan: %f,%f,%f,(%f)\n",x,res,tan(x),res-tan(x)); @@ -54,14 +54,14 @@ float tan_t(float x) { float acos_t(float x) { float negate = float(x < 0); float xabs = std::abs(x); - float ret = -0.0187293; + float ret = -0.0187293f; ret = ret * xabs; - ret = ret + 0.0742610; + ret = ret + 0.0742610f; ret = ret * xabs; - ret = ret - 0.2121144; + ret = ret - 0.2121144f; ret = ret * xabs; ret = ret + HALF_PI; - ret = ret * sqrt(1.0-xabs); + ret = ret * sqrt(1.0f-xabs); ret = ret - 2 * negate * ret; float res = negate * PI + ret; #ifdef WLED_DEBUG_MATH diff --git a/wled00/xml.cpp b/wled00/xml.cpp index c2e4ced7a..23de81793 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -587,7 +587,7 @@ void getSettingsJS(byte subPage, char* dest) sappends('s',SET_F("LT"),tm); getTimeString(tm); sappends('m',SET_F("(\"times\")[0]"),tm); - if ((int)(longitude*10.) || (int)(latitude*10.)) { + if ((int)(longitude*10.0f) || (int)(latitude*10.0f)) { sprintf_P(tm, PSTR("Sunrise: %02d:%02d Sunset: %02d:%02d"), hour(sunrise), minute(sunrise), hour(sunset), minute(sunset)); sappends('m',SET_F("(\"times\")[1]"),tm); }