Skip to content

Commit 8a0f94a

Browse files
committed
fix:fixed the bug that caused abnormal screen refreshing in some cases after enabling the local boot mode.
1 parent ba469d7 commit 8a0f94a

File tree

2 files changed

+5
-34
lines changed

2 files changed

+5
-34
lines changed

Extensions/EPaper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void EPaper::begin(uint8_t tc)
3333
void EPaper::update()
3434
{
3535
wake();
36-
36+
EPD_SET_WINDOW(0, 0, (_width - 1), (_height - 1));
3737
if(!_grayLevel)
3838
{
3939
#ifdef EPD_HORIZONTAL_MIRROR
@@ -122,10 +122,10 @@ void EPaper::updataPartial(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
122122

123123
#ifdef EPD_HORIZONTAL_MIRROR
124124
EPD_SET_WINDOW(x0, yy, x0 + w_aligned - 1, yy + hh - 1);
125-
EPD_PUSH_NEW_COLORS_PART_FLIP(w_aligned, hh, winbuf);
125+
EPD_PUSH_NEW_COLORS_FLIP(w_aligned, hh, winbuf);
126126
#else
127127
EPD_SET_WINDOW(x0, yy, x0 + w_aligned - 1, yy + hh - 1);
128-
EPD_PUSH_NEW_COLORS_PART(w_aligned, hh, winbuf);
128+
EPD_PUSH_NEW_COLORS(w_aligned, hh, winbuf);
129129
#endif
130130
EPD_UPDATE();
131131

TFT_Drivers/UC8179_Defines.h

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -219,42 +219,13 @@
219219
writedata (0x01); \
220220
} while (0)
221221

222-
#define EPD_PUSH_NEW_COLORS_PART(w, h, colors) \
223-
do \
224-
{ \
225-
writecommand(0x13); \
226-
for (int i = 0; i < w * h / 8; i++) \
227-
{ \
228-
writedata(colors[i]); \
229-
} \
230-
} while (0)
231-
232-
#define EPD_PUSH_NEW_COLORS_PART_FLIP(w, h, colors) \
233-
do \
234-
{ \
235-
writecommand(0x13); \
236-
uint16_t bytes_per_row = (w) / 8; \
237-
for (uint16_t row = 0; row < (h); row++) \
238-
{ \
239-
uint16_t start = row * bytes_per_row; \
240-
for (uint16_t col = 0; col < bytes_per_row; col++) \
241-
{ \
242-
uint8_t b = colors[start + (bytes_per_row - 1 - col)]; \
243-
b = ((b & 0xF0) >> 4) | ((b & 0x0F) << 4); \
244-
b = ((b & 0xCC) >> 2) | ((b & 0x33) << 2); \
245-
b = ((b & 0xAA) >> 1) | ((b & 0x55) << 1); \
246-
writedata(b); \
247-
} \
248-
} \
249-
} while (0)
250-
251222
#define EPD_PUSH_NEW_COLORS(w, h, colors) \
252223
do \
253224
{ \
254225
writecommand(0x13); \
255226
for (int i = 0; i < w * h / 8; i++) \
256227
{ \
257-
writedata(~colors[i]); \
228+
writedata(colors[i]); \
258229
} \
259230
} while (0)
260231

@@ -272,7 +243,7 @@
272243
b = ((b & 0xF0) >> 4) | ((b & 0x0F) << 4); \
273244
b = ((b & 0xCC) >> 2) | ((b & 0x33) << 2); \
274245
b = ((b & 0xAA) >> 1) | ((b & 0x55) << 1); \
275-
writedata(~b); \
246+
writedata(b); \
276247
} \
277248
} \
278249
} while (0)

0 commit comments

Comments
 (0)