Browse Source

preliminary

ZinggJM 8 năm trước cách đây
mục cha
commit
7f5224aeef
1 tập tin đã thay đổi với 4 bổ sung và 2 xóa
  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;