Removed fake brightness (#2349)

This commit is contained in:
Totoo 2024-11-08 08:47:22 +01:00 committed by GitHub
parent a153cd741d
commit c31fef0535
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 7 additions and 153 deletions

View file

@ -162,9 +162,6 @@ class IO {
}
void lcd_write_pixel(ui::Color pixel) {
if (get_dark_cover()) {
pixel.v = DARKENED_PIXEL(pixel.v, get_brightness());
}
lcd_write_data(pixel.v);
}
@ -173,18 +170,12 @@ class IO {
}
void lcd_write_pixels(ui::Color pixel, size_t n) {
if (get_dark_cover()) {
pixel.v = DARKENED_PIXEL(pixel.v, get_brightness());
}
while (n--) {
lcd_write_data(pixel.v);
}
}
void lcd_write_pixels_unrolled8(ui::Color pixel, size_t n) {
if (get_dark_cover()) {
pixel.v = DARKENED_PIXEL(pixel.v, get_brightness());
}
auto v = pixel.v;
n >>= 3;
while (n--) {
@ -232,9 +223,6 @@ class IO {
return switches_raw;
}
bool get_is_inverted();
bool get_dark_cover();
uint8_t get_brightness();
// TODO: cache the value ^^ & ^ to increaase performance, need a trigger cuz init doesn't work. And since the constructor is constexpr, we can't use with in class var to cache it. maybe cache from outside somewhere and pass it here as argument.
uint32_t io_update(const TouchPinsConfig write_value);
@ -416,13 +404,6 @@ 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()) {
// 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;
}