From 77940e392f868761d0c4cef4409a52d55b5948d0 Mon Sep 17 00:00:00 2001 From: David <6517959+powelllens@users.noreply.github.com> Date: Mon, 18 Jul 2022 15:31:55 +0200 Subject: [PATCH] Update epd4in2b_V2.cpp Bugfix to allow X Positions > 256. According to the PDF -> RED must be greater than HRST. This is currently not the case for x > 256. --- Arduino/epd4in2b_V2/epd4in2b_V2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Arduino/epd4in2b_V2/epd4in2b_V2.cpp b/Arduino/epd4in2b_V2/epd4in2b_V2.cpp index 94a8b2026..a9f0cc6a2 100644 --- a/Arduino/epd4in2b_V2/epd4in2b_V2.cpp +++ b/Arduino/epd4in2b_V2/epd4in2b_V2.cpp @@ -104,7 +104,7 @@ void Epd::SetPartialWindow(const unsigned char* buffer_black, const unsigned cha SendCommand(PARTIAL_WINDOW); SendData(x >> 8); SendData(x & 0xf8); // x should be the multiple of 8, the last 3 bit will always be ignored - SendData(((x & 0xf8) + w - 1) >> 8); + SendData((x + w - 1) >> 8); SendData(((x & 0xf8) + w - 1) | 0x07); SendData(y >> 8); SendData(y & 0xff); @@ -137,7 +137,7 @@ void Epd::SetPartialWindowBlack(const unsigned char* buffer_black, int x, int y, SendCommand(PARTIAL_WINDOW); SendData(x >> 8); SendData(x & 0xf8); // x should be the multiple of 8, the last 3 bit will always be ignored - SendData(((x & 0xf8) + w - 1) >> 8); + SendData((x + w - 1) >> 8); SendData(((x & 0xf8) + w - 1) | 0x07); SendData(y >> 8); SendData(y & 0xff);