8266 hotfix: solving connectivity problems

* it seems that `WiFiUDP.flsuh()` does something completely different from 8266, and  its actually causing WLED to stall on UI calls. So not usable on 8266.
* fixing a few compiler warnings about "comparing signed and unsigned"

NB: its a hotfix, we have to check if there are other problems on 8266. Also its definitely ugly, but it helps as a band aid.
This commit is contained in:
Frank
2023-08-22 22:55:05 +02:00
parent 1c7d5d766d
commit f689d5115b
6 changed files with 49 additions and 10 deletions

View File

@@ -1472,7 +1472,9 @@ class AudioReactive : public Usermod {
packetSize = fftUdp.parsePacket();
} catch(...) {
packetSize = 0; // low heap memory -> discard packet.
fftUdp.flush();
#ifdef ARDUINO_ARCH_ESP32
fftUdp.flush(); // this does not work on 8266
#endif
DEBUG_PRINTLN(F("receiveAudioData: parsePacket out of memory exception caught!"));
USER_FLUSH();
}
@@ -1828,7 +1830,9 @@ class AudioReactive : public Usermod {
if (have_new_sample) last_UDPTime = millis();
lastTime = millis();
} else {
fftUdp.flush(); // WLEDMM: Flush this if we haven't read it.
#ifdef ARDUINO_ARCH_ESP32
fftUdp.flush(); // WLEDMM: Flush this if we haven't read it. Does not work on 8266.
#endif
}
if (have_new_sample) syncVolumeSmth = volumeSmth; // remember received sample
else volumeSmth = syncVolumeSmth; // restore originally received sample for next run of dynamics limiter