Skip to content

Commit

Permalink
term: only partially clear buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
vroland committed Jun 7, 2020
1 parent 06f3c3d commit 60fb5da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/terminal/main/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -2539,7 +2539,8 @@ tresize(int col, int row)
if (render_fb_delete == NULL) {
render_fb_delete = heap_caps_malloc(EPD_WIDTH / 2 * EPD_HEIGHT, MALLOC_CAP_SPIRAM);
}

memset(render_fb_write, 255, EPD_WIDTH / 2 * EPD_HEIGHT);
memset(render_fb_delete, 255, EPD_WIDTH / 2 * EPD_HEIGHT);

/*
* slide screen to keep cursor where we expect it -
Expand Down Expand Up @@ -2751,8 +2752,6 @@ static void render_character(
}

void render() {
memset(render_fb_write, 255, EPD_WIDTH / 2 * EPD_HEIGHT);
memset(render_fb_delete, 255, EPD_WIDTH / 2 * EPD_HEIGHT);

int write_min_y = 100000;
int delete_min_y = 100000;
Expand Down Expand Up @@ -2829,6 +2828,7 @@ void render() {
if (!write_dirty) {
epd_poweroff();
}
memset(start_ptr, 255, EPD_WIDTH / 2 * height);
}

if (write_dirty) {
Expand All @@ -2851,6 +2851,7 @@ void render() {
epd_draw_image(area, start_ptr, BLACK_ON_WHITE);
epd_poweroff();
drawn_since_clear = true;
memset(start_ptr, 255, EPD_WIDTH / 2 * height);
}
}

Expand Down

0 comments on commit 60fb5da

Please sign in to comment.