From 7a38b04192b762d36bea1c233c58f225d5e69e08 Mon Sep 17 00:00:00 2001 From: sommermorgentraum <24917424+zxkmm@users.noreply.github.com> Date: Sat, 19 Oct 2024 21:31:49 +0800 Subject: [PATCH] fix read data of display (#2312) --- firmware/common/portapack_io.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firmware/common/portapack_io.hpp b/firmware/common/portapack_io.hpp index b25cdb7f..09646f2f 100644 --- a/firmware/common/portapack_io.hpp +++ b/firmware/common/portapack_io.hpp @@ -416,8 +416,12 @@ class IO { const auto value_low = data_read(); uint32_t original_value = (value_high << 8) | value_low; + if (get_is_inverted()) return original_value; + if (get_dark_cover()) { - original_value = DARKENED_PIXEL(original_value, get_brightness()); + // this is read data, so if the fake brightness is enabled AKA get_dark_cover() == true, + // then shift to back side AKA UNDARKENED_PIXEL, to prevent read shifted darkern info + original_value = UNDARKENED_PIXEL(original_value, get_brightness()); } return original_value; }