Fake brightness reimplementation (#2444)

* Fake brightness reimplementation
* indentation
* added call to the function which is caching the display settings values
* use cached values instead of pmem
This commit is contained in:
hackrfstuff 2024-12-26 23:23:02 +01:00 committed by GitHub
parent ef28e63a8c
commit bad57d1391
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 163 additions and 7 deletions

View file

@ -77,10 +77,24 @@ void IO::reference_oscillator(const bool enable) {
io_write(1, io_reg);
}
bool IO::get_dark_cover() {
return portapack::persistent_memory::apply_fake_brightness() & (!portapack::persistent_memory::config_lcd_inverted_mode());
}
bool IO::get_is_inverted() {
return portapack::persistent_memory::config_lcd_inverted_mode();
}
uint8_t IO::get_brightness() {
return portapack::persistent_memory::fake_brightness_level();
}
void IO::update_cached_values() {
inverted_enabled = get_is_inverted();
dark_cover_enabled = get_dark_cover();
brightness = get_brightness();
}
uint32_t IO::io_update(const TouchPinsConfig write_value) {
/* Very touchy code to save context of PortaPack data bus while the
* resistive touch pin drive is changed. Order of operations is