From d23814fefc32896ed4756b9ee831cadbd090830f Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sat, 4 Jun 2022 18:56:50 +0200 Subject: [PATCH] Reset memory layout after drawing text --- eink.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/eink.hpp b/eink.hpp index ce545fc..0704cdb 100644 --- a/eink.hpp +++ b/eink.hpp @@ -164,9 +164,6 @@ class Eink { template static void draw(const RleImage &rleImage) { - setRamXPos(); - setRamYPos(); - constexpr auto sendImageChannel = [](const auto command, const auto &image) { using image_t = std::remove_cvref_t; @@ -189,9 +186,6 @@ class Eink { static void clear(const Color color = Color::WHITE) { - setRamXPos(); - setRamYPos(); - constexpr auto getFillData = [](const auto &color) -> std::pair { switch (color) { case Color::BLACK: @@ -284,6 +278,10 @@ class Eink { sendChannel(Cmd::WRITE_RAM_BLACK); sendChannel(Cmd::WRITE_RAM_RED); + + setRamRange(); + setRamXPos(); + setRamYPos(); } template