فهرست منبع

Version 1.2.16

- fix for GDEH0154D67, to work independent of OTP version (ping-pong issue)
ZinggJM 5 سال پیش
والد
کامیت
788535f061
4فایلهای تغییر یافته به همراه10 افزوده شده و 12 حذف شده
  1. 6 5
      src/GxEPD2_BW.h
  2. 1 1
      src/GxEPD2_EPD.h
  3. 2 5
      src/epd/GxEPD2_154_D67.cpp
  4. 1 1
      src/epd/GxEPD2_154_D67.h

+ 6 - 5
src/GxEPD2_BW.h

@@ -165,7 +165,8 @@ class GxEPD2_BW : public GxEPD2_GFX_BASE_CLASS
     // display buffer content to screen, useful for full screen buffer
     // display buffer content to screen, useful for full screen buffer
     void display(bool partial_update_mode = false)
     void display(bool partial_update_mode = false)
     {
     {
-      epd2.writeImage(_buffer, 0, 0, WIDTH, _page_height, false, false, false, !partial_update_mode);
+      if (partial_update_mode) epd2.writeImage(_buffer, 0, 0, WIDTH, _page_height);
+      else epd2.writeImageForFullRefresh(_buffer, 0, 0, WIDTH, _page_height);
       epd2.refresh(partial_update_mode);
       epd2.refresh(partial_update_mode);
       if (epd2.hasFastPartialUpdate)
       if (epd2.hasFastPartialUpdate)
       {
       {
@@ -248,7 +249,7 @@ class GxEPD2_BW : public GxEPD2_GFX_BASE_CLASS
         }
         }
         else // full update
         else // full update
         {
         {
-          epd2.writeImage(_buffer, 0, 0, WIDTH, HEIGHT, false, false, false, true);
+          epd2.writeImageForFullRefresh(_buffer, 0, 0, WIDTH, HEIGHT);
           epd2.refresh(false);
           epd2.refresh(false);
           if (epd2.hasFastPartialUpdate)
           if (epd2.hasFastPartialUpdate)
           {
           {
@@ -302,7 +303,7 @@ class GxEPD2_BW : public GxEPD2_GFX_BASE_CLASS
       }
       }
       else // full update
       else // full update
       {
       {
-        if (!_second_phase) epd2.writeImage(_buffer, 0, page_ys, WIDTH, gx_uint16_min(_page_height, HEIGHT - page_ys), false, false, false, true);
+        if (!_second_phase) epd2.writeImageForFullRefresh(_buffer, 0, page_ys, WIDTH, gx_uint16_min(_page_height, HEIGHT - page_ys));
         else epd2.writeImageAgain(_buffer, 0, page_ys, WIDTH, gx_uint16_min(_page_height, HEIGHT - page_ys));
         else epd2.writeImageAgain(_buffer, 0, page_ys, WIDTH, gx_uint16_min(_page_height, HEIGHT - page_ys));
         _current_page++;
         _current_page++;
         if (_current_page == _pages)
         if (_current_page == _pages)
@@ -347,7 +348,7 @@ class GxEPD2_BW : public GxEPD2_GFX_BASE_CLASS
         }
         }
         else // full update
         else // full update
         {
         {
-          epd2.writeImage(_buffer, 0, 0, WIDTH, HEIGHT, false, false, false, true);
+          epd2.writeImageForFullRefresh(_buffer, 0, 0, WIDTH, HEIGHT);
           epd2.refresh(false);
           epd2.refresh(false);
           if (epd2.hasFastPartialUpdate)
           if (epd2.hasFastPartialUpdate)
           {
           {
@@ -389,7 +390,7 @@ class GxEPD2_BW : public GxEPD2_GFX_BASE_CLASS
           uint16_t page_ys = _current_page * _page_height;
           uint16_t page_ys = _current_page * _page_height;
           fillScreen(GxEPD_WHITE);
           fillScreen(GxEPD_WHITE);
           drawCallback(pv);
           drawCallback(pv);
-          epd2.writeImage(_buffer, 0, page_ys, WIDTH, gx_uint16_min(_page_height, HEIGHT - page_ys), false, false, false, true);
+          epd2.writeImageForFullRefresh(_buffer, 0, page_ys, WIDTH, gx_uint16_min(_page_height, HEIGHT - page_ys));
         }
         }
         epd2.refresh(false); // full update after first phase
         epd2.refresh(false); // full update after first phase
         if (epd2.hasFastPartialUpdate)
         if (epd2.hasFastPartialUpdate)

+ 1 - 1
src/GxEPD2_EPD.h

@@ -39,7 +39,7 @@ class GxEPD2_EPD
     virtual void writeScreenBuffer(uint8_t value) = 0; // init controller memory (default white)
     virtual void writeScreenBuffer(uint8_t value) = 0; // init controller memory (default white)
     // write to controller memory, without screen refresh; x and w should be multiple of 8
     // write to controller memory, without screen refresh; x and w should be multiple of 8
     virtual void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) = 0;
     virtual void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) = 0;
-    virtual void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm, bool for_full_refresh)
+    virtual void writeImageForFullRefresh(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false)
     {
     {
       // writeImage is independent from refresh mode for most controllers, exception e.g. SSD1681
       // writeImage is independent from refresh mode for most controllers, exception e.g. SSD1681
       writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
       writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);

+ 2 - 5
src/epd/GxEPD2_154_D67.cpp

@@ -53,12 +53,9 @@ void GxEPD2_154_D67::writeImage(const uint8_t bitmap[], int16_t x, int16_t y, in
   _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
   _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
 }
 }
 
 
-void GxEPD2_154_D67::writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm, bool for_full_refresh)
+void GxEPD2_154_D67::writeImageForFullRefresh(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
 {
 {
-  if (for_full_refresh)
-  {
-    _writeImage(0x26, bitmap, x, y, w, h, invert, mirror_y, pgm);
-  }
+  _writeImage(0x26, bitmap, x, y, w, h, invert, mirror_y, pgm);
   _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
   _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
 }
 }
 
 

+ 1 - 1
src/epd/GxEPD2_154_D67.h

@@ -39,7 +39,7 @@ class GxEPD2_154_D67 : public GxEPD2_EPD
     void writeScreenBufferAgain(uint8_t value = 0xFF); // init previous buffer controller memory (default white)
     void writeScreenBufferAgain(uint8_t value = 0xFF); // init previous buffer controller memory (default white)
     // write to controller memory, without screen refresh; x and w should be multiple of 8
     // write to controller memory, without screen refresh; x and w should be multiple of 8
     void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
     void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
-    void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm, bool for_full_refresh);
+    void writeImageForFullRefresh(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
     void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
     void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
                         int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
                         int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
     void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
     void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);