vroland / epdiy

EPDiy is a driver board for affordable e-Paper (or E-ink) displays.
https://vroland.github.io/epdiy-hardware/
GNU Lesser General Public License v3.0
1.25k stars 178 forks source link

How to refresh full screen without clean the buffer? #206

Closed lanistor closed 10 months ago

lanistor commented 1 year ago

How to refresh full screen without clean the buffer? epd_clear seems will clean the buffer data, then no way to render again.

I can only found the follow way, this will need malloc another buffer temply:

void epdiy_fullclear() {
  int fb_size = epd_rotated_display_width() * epd_rotated_display_height() / 2;
  uint8_t* buffer = epd_hl_get_framebuffer(&hl);

  void* copy_buffer = heap_caps_malloc(fb_size, MALLOC_CAP_SPIRAM);
  memcpy(copy_buffer, buffer, fb_size);

  epd_fullclear(&hl, temperature);

  memcpy(buffer, copy_buffer, fb_size);
  heap_caps_free(copy_buffer);

  epd_hl_update_screen(&hl, updateMode, temperature);
}
vroland commented 1 year ago

Hm, I suppose the highlevel API currently does not allow this, as it looks for parts that have changes first. Maybe an additional function like epd_hl_redraw would be nice that just re-daws everything. I suppose that would also help with #205 ...

lanistor commented 1 year ago

Thanks for reply.

martinberlin commented 10 months ago

Hello @lanistor What is the status of this? You made #217 pull-request but later was closed. Shall we add this to #205 as vroland suggested?

lanistor commented 10 months ago

I will create a new PR after tested v7, now i close this issues.