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

@@ -226,9 +226,15 @@ void sendNTPPacket()
bool checkNTPResponse()
{
#ifdef ARDUINO_ARCH_ESP32
ntpUdp.flush();
#endif
int cb = ntpUdp.parsePacket();
#ifdef ARDUINO_ARCH_ESP32
if (!cb) {ntpUdp.flush(); return false;} // WLEDMM flush buffer
#else
if (!cb) {return false;} // WLEDMM do not flush buffer
#endif
uint32_t ntpPacketReceivedTime = millis();
DEBUG_PRINT(F("NTP recv, l="));