Răsfoiți Sursa

### Version 1.1.9

fixes for large displays
ZinggJM 7 ani în urmă
părinte
comite
f465df9371

+ 6 - 1
README.md

@@ -13,6 +13,7 @@
 - 4k7/10k resistor divider may not work with flat cable extensions or Waveshare 4.2 board, use level converter then
 - do not forget to connect GND
 - the actual Waveshare display boards now have level converters and series regulator, safe for 5V
+- use 4k7 pull-down on SS for ESP8266 for boards with level converters
 
 ### Paged Drawing, Picture Loop
  - This library uses paged drawing to limit RAM use and cope with missing single pixel update support
@@ -67,7 +68,11 @@
 #### other supported panels
 - ED060SCT        6" grey levels, on Waveshare e-Paper IT8951 Driver HAT
 
-### Version 1.1.8
+### Version 1.1.9
+- note for ESP8266 when using SS for CS: (wiring suggestion) 
+- connect 4.7k pull-down from GPIO15 to GND if your board or shield has level converters
+- fixes for large displays (use uint16_t for buffer index)
+#### Version 1.1.8
 - fix for incomplete download in GxEPD2_WiFi_Example
 - added missing method displayWindow() to GxEPD2_GFX base class
 - fix and clean up of initial refresh for panels with differential update

+ 7 - 3
examples/GxEPD2_Example/GxEPD2_Example.ino

@@ -15,11 +15,13 @@
 
 // mapping suggestion from Waveshare SPI e-Paper to Wemos D1 mini
 // BUSY -> D2, RST -> D4, DC -> D3, CS -> D8, CLK -> D5, DIN -> D7, GND -> GND, 3.3V -> 3.3V
-// NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, use different pin in case
+// NOTE: connect 4.7k pull-down from D8 to GND if your board or shield has level converters
+// NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, use different pin in case, or 4k7 pull-down
 
 // mapping suggestion from Waveshare SPI e-Paper to generic ESP8266
 // BUSY -> GPIO4, RST -> GPIO2, DC -> GPIO0, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V
-// NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, use different pin in case
+// NOTE: connect 4.7k pull-down from GPIO15 to GND if your board or shield has level converters
+// NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, use different pin in case, or 4k7 pull-down
 
 // mapping of Waveshare e-Paper ESP8266 Driver Board
 // BUSY -> GPIO16, RST -> GPIO5, DC -> GPIO4, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V
@@ -179,7 +181,9 @@
 
 // ***** for mapping of Waveshare Universal e-Paper Raw Panel Driver Shield for Arduino / NUCLEO *****
 // the RST line is not connected through level converter, but has a pull up resistor and a pull down diode to the Arduino pin; this is safe for 5V Arduino
-// NOTE: the 11-pinholes for pin connectors are not through level converter, and the VCC pin is 5V, only FCP connector pins are through level converter
+// NOTE: the 11-pinholes for pin connectors are not through level converter, and the VCC pin is ~4.2V, only FCP connector pins are through level converter
+// NOTE: the VCC pin on the 11-pinholes for pin connectors shouldn't be used, it seems to get back-fed from Arduino data pins through protection diodes of the level converter
+// NOTE: the VCC pin should be fed from Arduino 5V pin for use on any 5V Arduino (did they forget to add this connection or add a jumper?)
 // select one and adapt to your mapping
 //GxEPD2_BW<GxEPD2_154, MAX_HEIGHT(GxEPD2_154)> display(GxEPD2_154(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
 //GxEPD2_BW<GxEPD2_213, MAX_HEIGHT(GxEPD2_213)> display(GxEPD2_213(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDE0213B1, phased out

+ 1 - 1
extras/Particle/examples/GxEPD2_ParticleExample/project.properties

@@ -1,2 +1,2 @@
 name=GxEPD2_ParticleExample
-dependencies.GxEPD2=1.1.8
+dependencies.GxEPD2=1.1.9

+ 1 - 1
library.properties

@@ -1,5 +1,5 @@
 name=GxEPD2
-version=1.1.8
+version=1.1.9
 author=Jean-Marc Zingg
 maintainer=Jean-Marc Zingg
 sentence=Arduino Display Library for SPI E-Paper displays from Dalian Good Display and Waveshare. 

+ 2 - 2
src/epd/GxEPD2_583.cpp

@@ -159,7 +159,7 @@ void GxEPD2_583::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t
   {
     if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
     delay(1); // yield() to avoid WDT on ESP8266 and ESP32
-    int16_t wb = (w + 1) / 2; // width bytes, bitmaps are padded
+    uint16_t wb = (w + 1) / 2; // width bytes, bitmaps are padded
     x -= x % 2; // byte boundary
     w = wb * 2; // byte boundary
     int16_t x1 = x < 0 ? 0 : x; // limit
@@ -181,7 +181,7 @@ void GxEPD2_583::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t
       {
         uint8_t data;
         // use wb, h of bitmap for index!
-        int16_t idx = mirror_y ? j + dx / 2 + ((h - 1 - (i + dy))) * wb : j + dx / 2 + (i + dy) * wb;
+        uint16_t idx = mirror_y ? j + dx / 2 + uint16_t((h - 1 - (i + dy))) * wb : j + dx / 2 + uint16_t(i + dy) * wb;
         if (pgm)
         {
 #if defined(__AVR) || defined(ESP8266) || defined(ESP32)

+ 2 - 2
src/epd/GxEPD2_750.cpp

@@ -159,7 +159,7 @@ void GxEPD2_750::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t
   {
     if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
     delay(1); // yield() to avoid WDT on ESP8266 and ESP32
-    int16_t wb = (w + 1) / 2; // width bytes, bitmaps are padded
+    uint16_t wb = (w + 1) / 2; // width bytes, bitmaps are padded
     x -= x % 2; // byte boundary
     w = wb * 2; // byte boundary
     int16_t x1 = x < 0 ? 0 : x; // limit
@@ -181,7 +181,7 @@ void GxEPD2_750::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t
       {
         uint8_t data;
         // use wb, h of bitmap for index!
-        int16_t idx = mirror_y ? j + dx / 2 + ((h - 1 - (i + dy))) * wb : j + dx / 2 + (i + dy) * wb;
+        uint16_t idx = mirror_y ? j + dx / 2 + uint16_t((h - 1 - (i + dy))) * wb : j + dx / 2 + uint16_t(i + dy) * wb;
         if (pgm)
         {
 #if defined(__AVR) || defined(ESP8266) || defined(ESP32)

+ 3 - 3
src/epd3c/GxEPD2_583c.cpp

@@ -129,7 +129,7 @@ void GxEPD2_583c::writeImage(const uint8_t* black, const uint8_t* color, int16_t
       if (color)
       {
         // use wb, h of bitmap for index!
-        int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb;
+        uint16_t idx = mirror_y ? j + dx / 8 + uint16_t((h - 1 - (i + dy))) * wb : j + dx / 8 + uint16_t(i + dy) * wb;
         if (pgm)
         {
 #if defined(__AVR) || defined(ESP8266) || defined(ESP32)
@@ -243,7 +243,7 @@ void GxEPD2_583c::writeNative(const uint8_t* data1, const uint8_t* data2, int16_
   {
     if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
     delay(1); // yield() to avoid WDT on ESP8266 and ESP32
-    int16_t wb = (w + 1) / 2; // width bytes, bitmaps are padded
+    uint16_t wb = (w + 1) / 2; // width bytes, bitmaps are padded
     x -= x % 2; // byte boundary
     w = wb * 2; // byte boundary
     int16_t x1 = x < 0 ? 0 : x; // limit
@@ -265,7 +265,7 @@ void GxEPD2_583c::writeNative(const uint8_t* data1, const uint8_t* data2, int16_
       {
         uint8_t data;
         // use wb, h of bitmap for index!
-        int16_t idx = mirror_y ? j + dx / 2 + ((h - 1 - (i + dy))) * wb : j + dx / 2 + (i + dy) * wb;
+        uint16_t idx = mirror_y ? j + dx / 2 + uint16_t((h - 1 - (i + dy))) * wb : j + dx / 2 + uint16_t(i + dy) * wb;
         if (pgm)
         {
 #if defined(__AVR) || defined(ESP8266) || defined(ESP32)

+ 3 - 3
src/epd3c/GxEPD2_750c.cpp

@@ -129,7 +129,7 @@ void GxEPD2_750c::writeImage(const uint8_t* black, const uint8_t* color, int16_t
       if (color)
       {
         // use wb, h of bitmap for index!
-        int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb;
+        uint16_t idx = mirror_y ? j + dx / 8 + uint16_t((h - 1 - (i + dy))) * wb : j + dx / 8 + uint16_t(i + dy) * wb;
         if (pgm)
         {
 #if defined(__AVR) || defined(ESP8266) || defined(ESP32)
@@ -240,7 +240,7 @@ void GxEPD2_750c::writeNative(const uint8_t* data1, const uint8_t* data2, int16_
   {
     if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
     delay(1); // yield() to avoid WDT on ESP8266 and ESP32
-    int16_t wb = (w + 1) / 2; // width bytes, bitmaps are padded
+    uint16_t wb = (w + 1) / 2; // width bytes, bitmaps are padded
     x -= x % 2; // byte boundary
     w = wb * 2; // byte boundary
     int16_t x1 = x < 0 ? 0 : x; // limit
@@ -262,7 +262,7 @@ void GxEPD2_750c::writeNative(const uint8_t* data1, const uint8_t* data2, int16_
       {
         uint8_t data;
         // use wb, h of bitmap for index!
-        int16_t idx = mirror_y ? j + dx / 2 + ((h - 1 - (i + dy))) * wb : j + dx / 2 + (i + dy) * wb;
+        uint16_t idx = mirror_y ? j + dx / 2 + uint16_t((h - 1 - (i + dy))) * wb : j + dx / 2 + uint16_t(i + dy) * wb;
         if (pgm)
         {
 #if defined(__AVR) || defined(ESP8266) || defined(ESP32)

+ 1 - 1
src/it8951/GxEPD2_it60.cpp

@@ -248,7 +248,7 @@ void GxEPD2_it60::writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t
     {
       uint8_t data;
       // use wb_bitmap, h_bitmap of bitmap for index!
-      int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap;
+      uint32_t idx = mirror_y ? x_part / 8 + (j + dx / 8) + uint32_t((h_bitmap - 1 - (y_part + i + dy))) * uint32_t(wb_bitmap) : x_part / 8 + j + dx / 8 + uint32_t(y_part + i + dy) * uint32_t(wb_bitmap);
       if (pgm)
       {
 #if defined(__AVR) || defined(ESP8266) || defined(ESP32)