mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 06:49:24 -05:00
WIP screem backlight brightness
This commit is contained in:
parent
5eef5b4e31
commit
42824e4aec
@ -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;
|
||||
|
@ -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]))
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user