This commit is contained in:
Xiaonan Shen 2023-03-20 00:58:46 -07:00 committed by GitHub
commit 41e4f23d51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -179,7 +179,7 @@ void Epd::SetPartialWindow(const unsigned char* buffer_black, int x, int y, int
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 & 0xfff8) + w - 1) >> 8);
SendData(((x & 0xf8) + w - 1) | 0x07);
SendData(y >> 8);
SendData(y & 0xff);

View file

@ -103,7 +103,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 & 0xfff8) + w - 1) >> 8);
SendData(((x & 0xf8) + w - 1) | 0x07);
SendData(y >> 8);
SendData(y & 0xff);
@ -136,7 +136,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 & 0xfff8) + w - 1) >> 8);
SendData(((x & 0xf8) + w - 1) | 0x07);
SendData(y >> 8);
SendData(y & 0xff);
@ -162,7 +162,7 @@ void Epd::SetPartialWindowRed(const unsigned char* buffer_red, int x, int y, int
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 & 0xfff8) + w - 1) >> 8);
SendData(((x & 0xf8) + w - 1) | 0x07);
SendData(y >> 8);
SendData(y & 0xff);