diff --git a/platformio.ini b/platformio.ini index 873592413..a20dab2c3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -247,6 +247,7 @@ lib_deps = platform = espressif32@5.2.0 platform_packages = build_flags = -g + -Wshadow=compatible-local ;; emit warning in case a local variable "shadows" another local one -DARDUINO_ARCH_ESP32 -DESP32 #-DCONFIG_LITTLEFS_FOR_IDF_3_2 -D CONFIG_ASYNC_TCP_USE_WDT=0 diff --git a/wled00/udp.cpp b/wled00/udp.cpp index 6d7d28202..afe7b3356 100644 --- a/wled00/udp.cpp +++ b/wled00/udp.cpp @@ -821,9 +821,9 @@ uint8_t realtimeBroadcast(uint8_t type, IPAddress client, uint16_t length, uint8 } } - byte buffer[ART_NET_HEADER_SIZE]; - memcpy_P(buffer, ART_NET_HEADER, ART_NET_HEADER_SIZE); - ddpUdp.write(buffer, ART_NET_HEADER_SIZE); // This doesn't change. Hard coded ID, OpCode, and protocol version. + byte header_buffer[ART_NET_HEADER_SIZE]; + memcpy_P(header_buffer, ART_NET_HEADER, ART_NET_HEADER_SIZE); + ddpUdp.write(header_buffer, ART_NET_HEADER_SIZE); // This doesn't change. Hard coded ID, OpCode, and protocol version. ddpUdp.write(sequenceNumber & 0xFF); // sequence number. 1..255 ddpUdp.write(0x00); // physical - more an FYI, not really used for anything. 0..3 ddpUdp.write((currentPacket) & 0xFF); // Universe LSB. 1 full packet == 1 full universe, so just use current packet number.