Skip to content

Commit 3b8cbaf

Browse files
committed
Version 3.0.7
- fix for incomplete download in GxEPD_WiFi_Example - added missing powerDown() in base class GxEPD and class GxGDEW0154Z04 - added missing getUTF8Width() for U8g2_for_Adafruit_GFX in GxFont_GFX
1 parent 17a26ea commit 3b8cbaf

File tree

17 files changed

+1043
-39
lines changed

17 files changed

+1043
-39
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ A simple E-Paper display library with common base class and separate IO class fo
5858

5959
### for pin mapping suggestions see ConnectingHardware.md
6060

61-
### Version 3.0.6
61+
### Version 3.0.7
62+
- fix for incomplete download in GxEPD_WiFi_Example
63+
- added missing powerDown() in base class GxEPD and class GxGDEW0154Z04
64+
- added missing getUTF8Width() for U8g2_for_Adafruit_GFX in GxFont_GFX
65+
#### Version 3.0.6
6266
- added GxGDEH0213B72, to support GDEH0213B72 2.13" b/w, replacement for GDE0213B1
6367
#### Version 3.0.5
6468
- added support for GDEW029T5

examples/GxEPD_WiFi_Example/GxEPD_WiFi_Example.ino

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// GxEPD_WiFi_Example : Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare.
22
// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines!
33
//
4-
// Display Library based on Demo Example from Good Display: http://www.good-display.com/download_list/downloadcategoryid=34&isMode=false.html
4+
// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html
55
//
66
// BMP handling code extracts taken from: https://github.com/prenticedavid/MCUFRIEND_kbv/tree/master/examples/showBMP_kbv_Uno
77
//
@@ -35,6 +35,13 @@
3535
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 13, DIN -> 11
3636
//
3737

38+
// mapping suggestion for Arduino MEGA
39+
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 53, CLK -> 52, DIN -> 51
40+
41+
// mapping suggestion for Arduino DUE
42+
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 77, CLK -> 76, DIN -> 75
43+
// SPI pins are also on 6 pin 2x3 SPI header
44+
3845
// include library, include base class, make path known
3946
#include <GxEPD.h>
4047

@@ -44,8 +51,10 @@
4451
//#include <GxGDEW0154Z17/GxGDEW0154Z17.h> // 1.54" b/w/r 152x152
4552
//#include <GxGDEW0213I5F/GxGDEW0213I5F.h> // 2.13" b/w 104x212 flexible
4653
//#include <GxGDE0213B1/GxGDE0213B1.h> // 2.13" b/w
54+
//#include <GxGDEH0213B72/GxGDEH0213B72.h> // 2.13" b/w new panel
4755
//#include <GxGDEW0213Z16/GxGDEW0213Z16.h> // 2.13" b/w/r
4856
//#include <GxGDEH029A1/GxGDEH029A1.h> // 2.9" b/w
57+
//#include <GxGDEW029T5/GxGDEW029T5.h> // 2.9" b/w IL0373
4958
//#include <GxGDEW029Z10/GxGDEW029Z10.h> // 2.9" b/w/r
5059
//#include <GxGDEW027C44/GxGDEW027C44.h> // 2.7" b/w/r
5160
//#include <GxGDEW027W3/GxGDEW027W3.h> // 2.7" b/w
@@ -253,7 +262,7 @@ void drawBitmapFrom_HTTP_ToBuffer(const char* host, const char* path, const char
253262
Serial.println(String("http://") + host + path + filename);
254263
client.print(String("GET ") + path + filename + " HTTP/1.1\r\n" +
255264
"Host: " + host + "\r\n" +
256-
"User-Agent: GxEPD2_Spiffs_Loader\r\n" +
265+
"User-Agent: GxEPD_WiFi_Example\r\n" +
257266
"Connection: close\r\n\r\n");
258267
Serial.println("request sent");
259268
while (client.connected())
@@ -342,7 +351,7 @@ void drawBitmapFrom_HTTP_ToBuffer(const char* host, const char* path, const char
342351
bytes_read += skip(client, rowPosition - bytes_read);
343352
for (uint16_t row = 0; row < h; row++, rowPosition += rowSize) // for each line
344353
{
345-
if (!connection_ok || !client.connected()) break;
354+
if (!connection_ok || !(client.connected() || client.available())) break;
346355
delay(1); // yield() to avoid WDT
347356
uint32_t in_remain = rowSize;
348357
uint32_t in_idx = 0;
@@ -353,7 +362,7 @@ void drawBitmapFrom_HTTP_ToBuffer(const char* host, const char* path, const char
353362
for (uint16_t col = 0; col < w; col++) // for each pixel
354363
{
355364
yield();
356-
if (!connection_ok || !client.connected()) break;
365+
if (!connection_ok || !(client.connected() || client.available())) break;
357366
// Time to read more pixel data?
358367
if (in_idx >= in_bytes) // ok, exact match for 24bit also (size IS multiple of 3)
359368
{
@@ -495,7 +504,7 @@ void drawBitmapFrom_HTTPS_ToBuffer(const char* host, const char* path, const cha
495504
Serial.println(String("https://") + host + path + filename);
496505
client.print(String("GET ") + path + filename + " HTTP/1.1\r\n" +
497506
"Host: " + host + "\r\n" +
498-
"User-Agent: GxEPD2_Spiffs_Loader\r\n" +
507+
"User-Agent: GxEPD_WiFi_Example\r\n" +
499508
"Connection: close\r\n\r\n");
500509
Serial.println("request sent");
501510
while (client.connected())
@@ -584,7 +593,7 @@ void drawBitmapFrom_HTTPS_ToBuffer(const char* host, const char* path, const cha
584593
bytes_read += skip(client, rowPosition - bytes_read);
585594
for (uint16_t row = 0; row < h; row++, rowPosition += rowSize) // for each line
586595
{
587-
if (!connection_ok || !client.connected()) break;
596+
if (!connection_ok || !(client.connected() || client.available())) break;
588597
delay(1); // yield() to avoid WDT
589598
uint32_t in_remain = rowSize;
590599
uint32_t in_idx = 0;
@@ -595,7 +604,7 @@ void drawBitmapFrom_HTTPS_ToBuffer(const char* host, const char* path, const cha
595604
for (uint16_t col = 0; col < w; col++) // for each pixel
596605
{
597606
yield();
598-
if (!connection_ok || !client.connected()) break;
607+
if (!connection_ok || !(client.connected() || client.available())) break;
599608
// Time to read more pixel data?
600609
if (in_idx >= in_bytes) // ok, exact match for 24bit also (size IS multiple of 3)
601610
{
@@ -760,7 +769,7 @@ uint32_t skip(WiFiClient& client, int32_t bytes)
760769
{
761770
int32_t remain = bytes;
762771
uint32_t start = millis();
763-
while (client.connected() && (remain > 0))
772+
while ((client.connected() || client.available()) && (remain > 0))
764773
{
765774
if (client.available())
766775
{
@@ -777,7 +786,7 @@ uint32_t read(WiFiClient& client, uint8_t* buffer, int32_t bytes)
777786
{
778787
int32_t remain = bytes;
779788
uint32_t start = millis();
780-
while (client.connected() && (remain > 0))
789+
while ((client.connected() || client.available()) && (remain > 0))
781790
{
782791
if (client.available())
783792
{

examples/GxFont_GFX_Example/GxFont_GFX_Example.ino

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@
5151
// mapping suggestion for AVR, UNO, NANO etc.
5252
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 13, DIN -> 11
5353

54+
// mapping suggestion for Arduino MEGA
55+
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 53, CLK -> 52, DIN -> 51
56+
57+
// mapping suggestion for Arduino DUE
58+
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 77, CLK -> 76, DIN -> 75
59+
// SPI pins are also on 6 pin 2x3 SPI header
60+
5461
// include library, include base class, make path known
5562
#include <GxEPD.h>
5663

@@ -62,7 +69,9 @@
6269
//#include <GxGDEP015OC1/GxGDEP015OC1.h> // 1.54" b/w
6370
//#include <GxGDEW0154Z04/GxGDEW0154Z04.h> // 1.54" b/w/r 200x200
6471
//#include <GxGDEW0154Z17/GxGDEW0154Z17.h> // 1.54" b/w/r 152x152
72+
//#include <GxGDEW0213I5F/GxGDEW0213I5F.h> // 2.13" b/w 104x212 flexible
6573
//#include <GxGDE0213B1/GxGDE0213B1.h> // 2.13" b/w
74+
//#include <GxGDEH0213B72/GxGDEH0213B72.h> // 2.13" b/w new panel
6675
//#include <GxGDEW0213Z16/GxGDEW0213Z16.h> // 2.13" b/w/r
6776
//#include <GxGDEH029A1/GxGDEH029A1.h> // 2.9" b/w
6877
//#include <GxGDEW029Z10/GxGDEW029Z10.h> // 2.9" b/w/r
@@ -318,6 +327,3 @@ void showTextFont(const char name[], uint8_t f, uint8_t size)
318327
display.update();
319328
}
320329
#endif
321-
322-
323-
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name=GxEPD_ParticleExample
2+
dependencies.GxEPD=3.0.7

0 commit comments

Comments
 (0)