WIP screem backlight brightness

This commit is contained in:
jLynx 2024-02-07 20:40:56 +13:00
parent 5eef5b4e31
commit 42824e4aec
3 changed files with 11 additions and 4 deletions

View File

@ -329,7 +329,8 @@ void EventDispatcher::handle_lcd_frame_sync() {
static_cast<ui::SystemView*>(top_widget)->paint_overlay();
painter.paint_widget_tree(top_widget);
portapack::backlight()->on();
// portapack::backlight()->on();
portapack::backlight()->set_level(28);
if (waiting_for_frame)
this->waiting_for_frame = false;

View File

@ -280,10 +280,14 @@ static const portapack::cpld::Config& portapack_cpld_config() {
: portapack::cpld::rev_20150901::config;
}
// Backlight* backlight() {
// return (portapack_model() == PortaPackModel::R2_20170522)
// ? static_cast<portapack::Backlight*>(&backlight_cat4004) // R2_20170522
// : static_cast<portapack::Backlight*>(&backlight_on_off); // R1_20150901
// }
Backlight* backlight() {
return (portapack_model() == PortaPackModel::R2_20170522)
? static_cast<portapack::Backlight*>(&backlight_cat4004) // R2_20170522
: static_cast<portapack::Backlight*>(&backlight_on_off); // R1_20150901
return static_cast<portapack::Backlight*>(&backlight_cat4004); // R1_20150901
}
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))

View File

@ -29,6 +29,7 @@ void BacklightOnOff::on() {
if (!is_on()) {
io.lcd_backlight(true);
on_ = true;
}
}
@ -40,6 +41,7 @@ void BacklightOnOff::off() {
}
void BacklightCAT4004::set_level(const value_t value) {
on_ = true;
auto target = value;
// Clip target value to valid range.