diff --git a/platformio.ini b/platformio.ini index 6532f467..3eb09e80 100644 --- a/platformio.ini +++ b/platformio.ini @@ -95,16 +95,6 @@ debug_flags = -D DEBUG=1 -D WLED_DEBUG -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT # This reduces the OTA size with ~45KB, so it's especially useful on low memory boards (512k/1m). # ------------------------------------------------------------------------------ build_flags = - -Wno-switch - -Wno-deprecated-declarations - -Wno-write-strings - -Wno-unused-variable - -Wno-unused-value - -Wno-sign-compare - -Wno-unused-but-set-variable - -Wno-return-type - -Wno-sequence-point - -Wno-narrowing -DMQTT_MAX_PACKET_SIZE=1024 -DSECURE_CLIENT=SECURE_CLIENT_BEARSSL -DBEARSSL_SSL_BASIC @@ -121,9 +111,6 @@ build_flags = ; -D USERMOD_SENSORSTOMQTT build_unflags = - -Wall - -Wreorder - -Wdeprecated-declarations # enables all features for travis CI build_flags_all_features = @@ -159,7 +146,7 @@ build_flags = -DMIMETYPE_MINIMAL [esp32] -build_flags = -w -g +build_flags = -g -DARDUINO_ARCH_ESP32 -DCONFIG_LITTLEFS_FOR_IDF_3_2 diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 3fdfcff1..af7cead8 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -1568,9 +1568,9 @@ uint16_t WS2812FX::mode_oscillate(void) if (SEGENV.call == 0) { - oscillators[0] = {SEGLEN/4, SEGLEN/8, 1, 1}; - oscillators[1] = {SEGLEN/4*3, SEGLEN/8, 1, 2}; - oscillators[2] = {SEGLEN/4*2, SEGLEN/8, -1, 1}; + oscillators[0] = {(int16_t)(SEGLEN/4), (int8_t)(SEGLEN/8), 1, 1}; + oscillators[1] = {(int16_t)(SEGLEN/4*3), (int8_t)(SEGLEN/8), 1, 2}; + oscillators[2] = {(int16_t)(SEGLEN/4*2), (int8_t)(SEGLEN/8), -1, 1}; } uint32_t cycleTime = 20 + (2 * (uint32_t)(255 - SEGMENT.speed)); @@ -1919,7 +1919,6 @@ uint16_t WS2812FX::mode_noise16_2() for (uint16_t i = 0; i < SEGLEN; i++) { uint16_t shift_x = SEGENV.step >> 6; // x as a function of time - uint16_t shift_y = SEGENV.step/42; uint32_t real_x = (i + shift_x) * scale; // calculate the coordinates within the noise field @@ -3198,8 +3197,8 @@ uint16_t WS2812FX::mode_plasma(void) { uint8_t thatPhase = beatsin8(7,-64,64); for (int i = 0; i < SEGLEN; i++) { // For each of the LED's in the strand, set color & brightness based on a wave as follows: - uint8_t colorIndex = cubicwave8((i*(1+ 3*(SEGMENT.speed >> 5)))+(thisPhase) & 0xFF)/2 // factor=23 // Create a wave and add a phase change and add another wave with its own phase change. - + cos8((i*(1+ 2*(SEGMENT.speed >> 5)))+(thatPhase) & 0xFF)/2; // factor=15 // Hey, you can even change the frequencies if you wish. + uint8_t colorIndex = cubicwave8(((i*(1+ 3*(SEGMENT.speed >> 5)))+(thisPhase)) & 0xFF)/2 // factor=23 // Create a wave and add a phase change and add another wave with its own phase change. + + cos8(((i*(1+ 2*(SEGMENT.speed >> 5)))+(thatPhase)) & 0xFF)/2; // factor=15 // Hey, you can even change the frequencies if you wish. uint8_t thisBright = qsub8(colorIndex, beatsin8(6,0, (255 - SEGMENT.intensity)|0x01 )); CRGB color = ColorFromPalette(currentPalette, colorIndex, thisBright, LINEARBLEND); setPixelColor(i, color.red, color.green, color.blue); diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index aa1f88a6..ea27e2ef 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -380,7 +380,6 @@ uint8_t WS2812FX::getPaletteCount() bool WS2812FX::setEffectConfig(uint8_t m, uint8_t s, uint8_t in, uint8_t p) { - uint8_t mainSeg = getMainSegmentId(); Segment& seg = _segments[getMainSegmentId()]; uint8_t modePrev = seg.mode, speedPrev = seg.speed, intensityPrev = seg.intensity, palettePrev = seg.palette; diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 2175c97b..b21fd147 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -446,7 +446,6 @@ void serializeConfig() { JsonArray hw_led_ins = hw_led.createNestedArray("ins"); - uint16_t start = 0; for (uint8_t s = 0; s < busses.getNumBusses(); s++) { Bus *bus = busses.getBus(s); if (!bus || bus->getLength()==0) break; diff --git a/wled00/e131.cpp b/wled00/e131.cpp index 58d63779..9ca092a9 100644 --- a/wled00/e131.cpp +++ b/wled00/e131.cpp @@ -35,7 +35,8 @@ void handleDDPPacket(e131_packet_t* p) { realtimeLock(realtimeTimeoutMs, REALTIME_MODE_DDP); for (uint16_t i = start; i < stop; i++) { - setRealtimePixel(i, data[c++], data[c++], data[c++], 0); + setRealtimePixel(i, data[c], data[c+1], data[c+2], 0); + c+=3; } bool push = p->flags & DDP_PUSH_FLAG; @@ -187,11 +188,13 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){ uint16_t ledsTotal = previousLeds + (dmxChannels - dmxOffset +1) / dmxChannelsPerLed; if (!is4Chan) { for (uint16_t i = previousLeds; i < ledsTotal; i++) { - setRealtimePixel(i, e131_data[dmxOffset++], e131_data[dmxOffset++], e131_data[dmxOffset++], 0); + setRealtimePixel(i, e131_data[dmxOffset], e131_data[dmxOffset+1], e131_data[dmxOffset+2], 0); + dmxOffset+=3; } } else { for (uint16_t i = previousLeds; i < ledsTotal; i++) { - setRealtimePixel(i, e131_data[dmxOffset++], e131_data[dmxOffset++], e131_data[dmxOffset++], e131_data[dmxOffset++]); + setRealtimePixel(i, e131_data[dmxOffset], e131_data[dmxOffset+1], e131_data[dmxOffset+2], e131_data[dmxOffset+3]); + dmxOffset+=4; } } break; diff --git a/wled00/file.cpp b/wled00/file.cpp index c6e8c413..352b6af9 100644 --- a/wled00/file.cpp +++ b/wled00/file.cpp @@ -34,7 +34,6 @@ File f; //wrapper to find out how long closing takes void closeFile() { DEBUGFS_PRINT(F("Close -> ")); - uint32_t s = millis(); f.close(); DEBUGFS_PRINTF("took %d ms\n", millis() - s); doCloseFile = false; @@ -53,7 +52,6 @@ bool bufferedFind(const char *target, bool fromStart = true) { size_t targetLen = strlen(target); size_t index = 0; - byte c; uint16_t bufsize = 0, count = 0; byte buf[FS_BUFSIZE]; if (fromStart) f.seek(0); diff --git a/wled00/json.cpp b/wled00/json.cpp index fdd4accd..94d880a4 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -134,7 +134,6 @@ void deserializeSegment(JsonObject elem, byte it) if (sz == 0 && sz > 4) break; int rgbw[] = {0,0,0,0}; - byte cp = copyArray(icol, rgbw); if (set < 2) stop = start + 1; for (uint16_t i = start; i < stop; i++) { diff --git a/wled00/lx_parser.cpp b/wled00/lx_parser.cpp index 806bd74a..e51308c2 100644 --- a/wled00/lx_parser.cpp +++ b/wled00/lx_parser.cpp @@ -23,7 +23,6 @@ bool parseLx(int lxValue, byte rgbw[4]) ok = true; float tmpBri = floor((lxValue - 200000000) / 10000); ; uint16_t ct = (lxValue - 200000000) - (((uint8_t)tmpBri) * 10000); - float temp = 0; tmpBri *= 2.55; constrain(tmpBri, 0, 255); diff --git a/wled00/src/dependencies/async-mqtt-client/AsyncMqttClient.cpp b/wled00/src/dependencies/async-mqtt-client/AsyncMqttClient.cpp index f62e1ef4..d0c44cb6 100644 --- a/wled00/src/dependencies/async-mqtt-client/AsyncMqttClient.cpp +++ b/wled00/src/dependencies/async-mqtt-client/AsyncMqttClient.cpp @@ -37,10 +37,10 @@ AsyncMqttClient::AsyncMqttClient() _client.onPoll([](void* obj, AsyncClient* c) { (static_cast(obj))->_onPoll(c); }, this); #ifdef ESP32 - sprintf(_generatedClientId, "esp32%06x", ESP.getEfuseMac()); + sprintf(_generatedClientId, "esp32%06x", (uint32_t)ESP.getEfuseMac()); _xSemaphore = xSemaphoreCreateMutex(); #elif defined(ESP8266) - sprintf(_generatedClientId, "esp8266%06x", ESP.getChipId()); + sprintf(_generatedClientId, "esp8266%06x", (uint32_t)ESP.getChipId()); #endif _clientId = _generatedClientId; diff --git a/wled00/src/dependencies/blynk/Blynk/BlynkProtocolDefs.h b/wled00/src/dependencies/blynk/Blynk/BlynkProtocolDefs.h index 56e6abae..d294a626 100644 --- a/wled00/src/dependencies/blynk/Blynk/BlynkProtocolDefs.h +++ b/wled00/src/dependencies/blynk/Blynk/BlynkProtocolDefs.h @@ -93,7 +93,9 @@ struct BlynkHeader } BLYNK_ATTR_PACKED; -#if !defined(htons) && (defined(ARDUINO) || defined(ESP8266) || defined(PARTICLE) || defined(__MBED__)) +#if defined(ESP32) + #include +#elif !defined(htons) && (defined(ARDUINO) || defined(ESP8266) || defined(PARTICLE) || defined(__MBED__)) #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #define htons(x) ( ((x)<<8) | (((x)>>8)&0xFF) ) #define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \ diff --git a/wled00/src/dependencies/dmx/ESPDMX.cpp b/wled00/src/dependencies/dmx/ESPDMX.cpp index f3ece1c8..6ad1268e 100644 --- a/wled00/src/dependencies/dmx/ESPDMX.cpp +++ b/wled00/src/dependencies/dmx/ESPDMX.cpp @@ -77,10 +77,9 @@ void DMXESPSerial::write(int Channel, uint8_t value) { } void DMXESPSerial::end() { - delete dmxData; chanSize = 0; Serial1.end(); - dmxStarted == false; + dmxStarted = false; } void DMXESPSerial::update() { diff --git a/wled00/src/dependencies/espalexa/Espalexa.h b/wled00/src/dependencies/espalexa/Espalexa.h index 0ec4e2e5..5e7dc837 100644 --- a/wled00/src/dependencies/espalexa/Espalexa.h +++ b/wled00/src/dependencies/espalexa/Espalexa.h @@ -101,8 +101,8 @@ private: case EspalexaDeviceType::whitespectrum: return PSTR("Color temperature light"); case EspalexaDeviceType::color: return PSTR("Color light"); case EspalexaDeviceType::extendedcolor: return PSTR("Extended color light"); + default: return ""; } - return ""; } const char* modelidString(EspalexaDeviceType t) @@ -113,8 +113,8 @@ private: case EspalexaDeviceType::whitespectrum: return "LWT010"; case EspalexaDeviceType::color: return "LST001"; case EspalexaDeviceType::extendedcolor: return "LCT015"; + default: return ""; } - return ""; } void encodeLightId(uint8_t idx, char* out) diff --git a/wled00/src/dependencies/espalexa/EspalexaDevice.cpp b/wled00/src/dependencies/espalexa/EspalexaDevice.cpp index 8bdd780d..d7d0920f 100644 --- a/wled00/src/dependencies/espalexa/EspalexaDevice.cpp +++ b/wled00/src/dependencies/espalexa/EspalexaDevice.cpp @@ -112,7 +112,6 @@ uint32_t EspalexaDevice::getRGB() { if (_rgb != 0) return _rgb; //color has not changed byte rgb[4]{0, 0, 0, 0}; - float r, g, b, w; if (_mode == EspalexaColorMode::none) return 0; diff --git a/wled00/um_manager.cpp b/wled00/um_manager.cpp index 51fcd0ec..4d07226e 100644 --- a/wled00/um_manager.cpp +++ b/wled00/um_manager.cpp @@ -32,6 +32,7 @@ bool UsermodManager::add(Usermod* um) if (numMods >= WLED_MAX_USERMODS || um == nullptr) return false; ums[numMods] = um; numMods++; + return true; } byte UsermodManager::getModCount() {return numMods;} \ No newline at end of file diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 651f484e..bedec844 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -136,8 +136,6 @@ void prepareHostname(char* hostname) //handle Ethernet connection event void WiFiEvent(WiFiEvent_t event) { - char hostname[25] = "wled-"; - switch (event) { #if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET) case SYSTEM_EVENT_ETH_START: @@ -290,7 +288,6 @@ void WLED::setup() DEBUG_PRINT("esp8266 "); DEBUG_PRINTLN(ESP.getCoreVersion()); #endif - int heapPreAlloc = ESP.getFreeHeap(); DEBUG_PRINT("heap "); DEBUG_PRINTLN(ESP.getFreeHeap()); registerUsermods(); diff --git a/wled00/wled.h b/wled00/wled.h index 202b9da7..678a4ca6 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -65,7 +65,9 @@ #include #include //#include "SPIFFS.h" - #define CONFIG_LITTLEFS_FOR_IDF_3_2 + #ifndef CONFIG_LITTLEFS_FOR_IDF_3_2 + #define CONFIG_LITTLEFS_FOR_IDF_3_2 + #endif #include #endif @@ -310,7 +312,7 @@ WLED_GLOBAL bool huePollingEnabled _INIT(false); // poll hue bridge fo WLED_GLOBAL uint16_t huePollIntervalMs _INIT(2500); // low values (< 1sec) may cause lag but offer quicker response WLED_GLOBAL char hueApiKey[47] _INIT("api"); // key token will be obtained from bridge WLED_GLOBAL byte huePollLightId _INIT(1); // ID of hue lamp to sync to. Find the ID in the hue app ("about" section) -WLED_GLOBAL IPAddress hueIP _INIT((0, 0, 0, 0)); // IP address of the bridge +WLED_GLOBAL IPAddress hueIP _INIT_N((( 0, 0, 0, 0))); // IP address of the bridge WLED_GLOBAL bool hueApplyOnOff _INIT(true); WLED_GLOBAL bool hueApplyBri _INIT(true); WLED_GLOBAL bool hueApplyColor _INIT(true); @@ -473,7 +475,7 @@ WLED_GLOBAL int16_t currentPlaylist _INIT(0); // realtime WLED_GLOBAL byte realtimeMode _INIT(REALTIME_MODE_INACTIVE); WLED_GLOBAL byte realtimeOverride _INIT(REALTIME_OVERRIDE_NONE); -WLED_GLOBAL IPAddress realtimeIP _INIT((0, 0, 0, 0)); +WLED_GLOBAL IPAddress realtimeIP _INIT_N(((0, 0, 0, 0)));; WLED_GLOBAL unsigned long realtimeTimeout _INIT(0); WLED_GLOBAL uint8_t tpmPacketCount _INIT(0); WLED_GLOBAL uint16_t tpmPayloadFrameSize _INIT(0); diff --git a/wled00/wled_server.cpp b/wled00/wled_server.cpp index cae23c9d..2ae24a53 100644 --- a/wled00/wled_server.cpp +++ b/wled00/wled_server.cpp @@ -245,7 +245,7 @@ bool handleIfNoneMatchCacheHeader(AsyncWebServerRequest* request) return false; } -bool setStaticContentCacheHeaders(AsyncWebServerResponse *response) +void setStaticContentCacheHeaders(AsyncWebServerResponse *response) { response->addHeader(F("Cache-Control"),"max-age=2592000"); response->addHeader(F("ETag"), String(VERSION)); diff --git a/wled00/xml.cpp b/wled00/xml.cpp index 99b8b241..c7161193 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -313,7 +313,7 @@ void getSettingsJS(byte subPage, char* dest) sappend('v',SET_F("LA"),strip.milliampsPerLed); if (strip.currentMilliamps) { - sappends('m',SET_F("(\"pow\")[0]"),""); + sappends('m',SET_F("(\"pow\")[0]"),(char*)""); olen -= 2; //delete "; oappendi(strip.currentMilliamps); oappend(SET_F("mA\";"));