Skip to content

Commit

Permalink
fix read data of display (#2312)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxkmm authored Oct 19, 2024
1 parent 9f84ccb commit 7a38b04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion firmware/common/portapack_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7a38b04

Please sign in to comment.