Skip to content

Commit

Permalink
Version 3.0.7
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ZinggJM committed May 28, 2019
1 parent 17a26ea commit 3b8cbaf
Show file tree
Hide file tree
Showing 17 changed files with 1,043 additions and 39 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ A simple E-Paper display library with common base class and separate IO class fo

### for pin mapping suggestions see ConnectingHardware.md

### Version 3.0.6
### 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
#### Version 3.0.6
- added GxGDEH0213B72, to support GDEH0213B72 2.13" b/w, replacement for GDE0213B1
#### Version 3.0.5
- added support for GDEW029T5
Expand Down
27 changes: 18 additions & 9 deletions examples/GxEPD_WiFi_Example/GxEPD_WiFi_Example.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// GxEPD_WiFi_Example : Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare.
// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines!
//
// Display Library based on Demo Example from Good Display: http://www.good-display.com/download_list/downloadcategoryid=34&isMode=false.html
// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html
//
// BMP handling code extracts taken from: https://github.com/prenticedavid/MCUFRIEND_kbv/tree/master/examples/showBMP_kbv_Uno
//
Expand Down Expand Up @@ -35,6 +35,13 @@
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 13, DIN -> 11
//

// mapping suggestion for Arduino MEGA
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 53, CLK -> 52, DIN -> 51

// mapping suggestion for Arduino DUE
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 77, CLK -> 76, DIN -> 75
// SPI pins are also on 6 pin 2x3 SPI header

// include library, include base class, make path known
#include <GxEPD.h>

Expand All @@ -44,8 +51,10 @@
//#include <GxGDEW0154Z17/GxGDEW0154Z17.h> // 1.54" b/w/r 152x152
//#include <GxGDEW0213I5F/GxGDEW0213I5F.h> // 2.13" b/w 104x212 flexible
//#include <GxGDE0213B1/GxGDE0213B1.h> // 2.13" b/w
//#include <GxGDEH0213B72/GxGDEH0213B72.h> // 2.13" b/w new panel
//#include <GxGDEW0213Z16/GxGDEW0213Z16.h> // 2.13" b/w/r
//#include <GxGDEH029A1/GxGDEH029A1.h> // 2.9" b/w
//#include <GxGDEW029T5/GxGDEW029T5.h> // 2.9" b/w IL0373
//#include <GxGDEW029Z10/GxGDEW029Z10.h> // 2.9" b/w/r
//#include <GxGDEW027C44/GxGDEW027C44.h> // 2.7" b/w/r
//#include <GxGDEW027W3/GxGDEW027W3.h> // 2.7" b/w
Expand Down Expand Up @@ -253,7 +262,7 @@ void drawBitmapFrom_HTTP_ToBuffer(const char* host, const char* path, const char
Serial.println(String("http://") + host + path + filename);
client.print(String("GET ") + path + filename + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"User-Agent: GxEPD2_Spiffs_Loader\r\n" +
"User-Agent: GxEPD_WiFi_Example\r\n" +
"Connection: close\r\n\r\n");
Serial.println("request sent");
while (client.connected())
Expand Down Expand Up @@ -342,7 +351,7 @@ void drawBitmapFrom_HTTP_ToBuffer(const char* host, const char* path, const char
bytes_read += skip(client, rowPosition - bytes_read);
for (uint16_t row = 0; row < h; row++, rowPosition += rowSize) // for each line
{
if (!connection_ok || !client.connected()) break;
if (!connection_ok || !(client.connected() || client.available())) break;
delay(1); // yield() to avoid WDT
uint32_t in_remain = rowSize;
uint32_t in_idx = 0;
Expand All @@ -353,7 +362,7 @@ void drawBitmapFrom_HTTP_ToBuffer(const char* host, const char* path, const char
for (uint16_t col = 0; col < w; col++) // for each pixel
{
yield();
if (!connection_ok || !client.connected()) break;
if (!connection_ok || !(client.connected() || client.available())) break;
// Time to read more pixel data?
if (in_idx >= in_bytes) // ok, exact match for 24bit also (size IS multiple of 3)
{
Expand Down Expand Up @@ -495,7 +504,7 @@ void drawBitmapFrom_HTTPS_ToBuffer(const char* host, const char* path, const cha
Serial.println(String("https://") + host + path + filename);
client.print(String("GET ") + path + filename + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"User-Agent: GxEPD2_Spiffs_Loader\r\n" +
"User-Agent: GxEPD_WiFi_Example\r\n" +
"Connection: close\r\n\r\n");
Serial.println("request sent");
while (client.connected())
Expand Down Expand Up @@ -584,7 +593,7 @@ void drawBitmapFrom_HTTPS_ToBuffer(const char* host, const char* path, const cha
bytes_read += skip(client, rowPosition - bytes_read);
for (uint16_t row = 0; row < h; row++, rowPosition += rowSize) // for each line
{
if (!connection_ok || !client.connected()) break;
if (!connection_ok || !(client.connected() || client.available())) break;
delay(1); // yield() to avoid WDT
uint32_t in_remain = rowSize;
uint32_t in_idx = 0;
Expand All @@ -595,7 +604,7 @@ void drawBitmapFrom_HTTPS_ToBuffer(const char* host, const char* path, const cha
for (uint16_t col = 0; col < w; col++) // for each pixel
{
yield();
if (!connection_ok || !client.connected()) break;
if (!connection_ok || !(client.connected() || client.available())) break;
// Time to read more pixel data?
if (in_idx >= in_bytes) // ok, exact match for 24bit also (size IS multiple of 3)
{
Expand Down Expand Up @@ -760,7 +769,7 @@ uint32_t skip(WiFiClient& client, int32_t bytes)
{
int32_t remain = bytes;
uint32_t start = millis();
while (client.connected() && (remain > 0))
while ((client.connected() || client.available()) && (remain > 0))
{
if (client.available())
{
Expand All @@ -777,7 +786,7 @@ uint32_t read(WiFiClient& client, uint8_t* buffer, int32_t bytes)
{
int32_t remain = bytes;
uint32_t start = millis();
while (client.connected() && (remain > 0))
while ((client.connected() || client.available()) && (remain > 0))
{
if (client.available())
{
Expand Down
12 changes: 9 additions & 3 deletions examples/GxFont_GFX_Example/GxFont_GFX_Example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
// mapping suggestion for AVR, UNO, NANO etc.
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 13, DIN -> 11

// mapping suggestion for Arduino MEGA
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 53, CLK -> 52, DIN -> 51

// mapping suggestion for Arduino DUE
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 77, CLK -> 76, DIN -> 75
// SPI pins are also on 6 pin 2x3 SPI header

// include library, include base class, make path known
#include <GxEPD.h>

Expand All @@ -62,7 +69,9 @@
//#include <GxGDEP015OC1/GxGDEP015OC1.h> // 1.54" b/w
//#include <GxGDEW0154Z04/GxGDEW0154Z04.h> // 1.54" b/w/r 200x200
//#include <GxGDEW0154Z17/GxGDEW0154Z17.h> // 1.54" b/w/r 152x152
//#include <GxGDEW0213I5F/GxGDEW0213I5F.h> // 2.13" b/w 104x212 flexible
//#include <GxGDE0213B1/GxGDE0213B1.h> // 2.13" b/w
//#include <GxGDEH0213B72/GxGDEH0213B72.h> // 2.13" b/w new panel
//#include <GxGDEW0213Z16/GxGDEW0213Z16.h> // 2.13" b/w/r
//#include <GxGDEH029A1/GxGDEH029A1.h> // 2.9" b/w
//#include <GxGDEW029Z10/GxGDEW029Z10.h> // 2.9" b/w/r
Expand Down Expand Up @@ -318,6 +327,3 @@ void showTextFont(const char name[], uint8_t f, uint8_t size)
display.update();
}
#endif



Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name=GxEPD_ParticleExample
dependencies.GxEPD=3.0.7
Loading

0 comments on commit 3b8cbaf

Please sign in to comment.