ZinggJM vor 8 Jahren
Ursprung
Commit
7f5224aeef
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 4 2
      examples/GxEPD2_WiFi_Example/GxEPD2_WiFi_Example.ino

+ 4 - 2
examples/GxEPD2_WiFi_Example/GxEPD2_WiFi_Example.ino

@@ -317,8 +317,9 @@ void showBitmapFrom_HTTP(const char* host, const char* path, const char* filenam
         {
           delay(1); // yield() to avoid WDT
           uint32_t got = client.read(buffer, rowSize);
-          while (got < rowSize)
+          while ((got < rowSize) && client.connected())
           {
+            delay(1); // yield() to avoid WDT
             got += client.read(buffer + got, rowSize - got);
           }
           bytes_read += got;
@@ -463,8 +464,9 @@ void showBitmapFrom_HTTPS(const char* host, const char* path, const char* filena
         {
           delay(1); // yield() to avoid WDT
           uint32_t got = client.read(buffer, rowSize);
-          while (got < rowSize)
+          while ((got < rowSize) && client.connected())
           {
+            delay(1); // yield() to avoid WDT
             got += client.read(buffer + got, rowSize - got);
           }
           bytes_read += got;