Kaynağa Gözat

Version 1.6.3

- updated GxEPD2_4C.h with WIDTH_VISIBLE (for GDEY0213F51)
- updated GxEPD2_154_Z90c.cpp powerOff() handling
ZinggJM 1 yıl önce
ebeveyn
işleme
caf3622fae
4 değiştirilmiş dosya ile 18 ekleme ve 12 silme
  1. 4 1
      README.md
  2. 1 1
      library.properties
  3. 2 2
      src/GxEPD2_4C.h
  4. 11 8
      src/epd3c/GxEPD2_154_Z90c.cpp

+ 4 - 1
README.md

@@ -163,7 +163,10 @@
 - But only few panels at any time, and only panels from known sources. 
 - Adding support will take as much time as needed.
 
-### Version 1.6.2
+### Version 1.6.3
+- updated GxEPD2_4C.h with WIDTH_VISIBLE (for GDEY0213F51)
+- updated GxEPD2_154_Z90c.cpp powerOff() handling
+#### Version 1.6.2
 - fixed support for GDEY029T71H 2.9" b/w 168x384, SSD1685
 - GxEPD2_WiFi_Example: added direct (non-buffered) BMP download to 7-color displays
 - some minor fixes

+ 1 - 1
library.properties

@@ -1,5 +1,5 @@
 name=GxEPD2
-version=1.6.2
+version=1.6.3
 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/GxEPD2_4C.h

@@ -79,9 +79,9 @@ class GxEPD2_4C : public GxEPD2_GFX_BASE_CLASS
   public:
     GxEPD2_Type epd2;
 #if ENABLE_GxEPD2_GFX
-    GxEPD2_4C(GxEPD2_Type epd2_instance) : GxEPD2_GFX_BASE_CLASS(epd2, GxEPD2_Type::WIDTH, GxEPD2_Type::HEIGHT), epd2(epd2_instance)
+    GxEPD2_4C(GxEPD2_Type epd2_instance) : GxEPD2_GFX_BASE_CLASS(epd2, GxEPD2_Type::WIDTH_VISIBLE, GxEPD2_Type::HEIGHT), epd2(epd2_instance)
 #else
-    GxEPD2_4C(GxEPD2_Type epd2_instance) : GxEPD2_GFX_BASE_CLASS(GxEPD2_Type::WIDTH, GxEPD2_Type::HEIGHT), epd2(epd2_instance)
+    GxEPD2_4C(GxEPD2_Type epd2_instance) : GxEPD2_GFX_BASE_CLASS(GxEPD2_Type::WIDTH_VISIBLE, GxEPD2_Type::HEIGHT), epd2(epd2_instance)
 #endif
     {
       _page_height = page_height;

+ 11 - 8
src/epd3c/GxEPD2_154_Z90c.cpp

@@ -282,7 +282,7 @@ void GxEPD2_154_Z90c::refresh(int16_t x, int16_t y, int16_t w, int16_t h)
   int16_t y1 = y < 0 ? 0 : y; // limit
   w1 = x1 + w1 < int16_t(WIDTH) ? w1 : int16_t(WIDTH) - x1; // limit
   h1 = y1 + h1 < int16_t(HEIGHT) ? h1 : int16_t(HEIGHT) - y1; // limit
-  if ((w1 <= 0) || (h1 <= 0)) return; 
+  if ((w1 <= 0) || (h1 <= 0)) return;
   // make x1, w1 multiple of 8
   w1 += x1 % 8;
   if (w1 % 8 > 0) w1 += 8 - w1 % 8;
@@ -341,11 +341,14 @@ void GxEPD2_154_Z90c::_PowerOn()
 
 void GxEPD2_154_Z90c::_PowerOff()
 {
-  _writeCommand(0x22);
-  _writeData(0xc3);
-  _writeCommand(0x20);
-  _waitWhileBusy("_PowerOff", power_off_time);
-  _power_is_on = false;
+  if (_power_is_on)
+  {
+    _writeCommand(0x22);
+    _writeData(0xc3);
+    _writeCommand(0x20);
+    _waitWhileBusy("_PowerOff", power_off_time);
+    _power_is_on = false;
+  }
 }
 
 void GxEPD2_154_Z90c::_InitDisplay()
@@ -369,13 +372,11 @@ void GxEPD2_154_Z90c::_InitDisplay()
 void GxEPD2_154_Z90c::_Init_Full()
 {
   _InitDisplay();
-  _PowerOn();
 }
 
 void GxEPD2_154_Z90c::_Init_Part()
 {
   _InitDisplay();
-  _PowerOn();
 }
 
 void GxEPD2_154_Z90c::_Update_Full()
@@ -384,6 +385,7 @@ void GxEPD2_154_Z90c::_Update_Full()
   _writeData(0xF7);
   _writeCommand(0x20);  //Activate Display Update Sequence
   _waitWhileBusy("_Update_Full", full_refresh_time);
+  _power_is_on = false;
 }
 
 void GxEPD2_154_Z90c::_Update_Part()
@@ -392,4 +394,5 @@ void GxEPD2_154_Z90c::_Update_Part()
   _writeData(0xF7);
   _writeCommand(0x20);  //Activate Display Update Sequence
   _waitWhileBusy("_Update_Part", partial_refresh_time);
+  _power_is_on = false;
 }