mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-29 09:07:17 -04:00
Backlight: Add abstraction for support of different hardware.
This commit is contained in:
parent
e695d496c5
commit
aa189a3462
7 changed files with 240 additions and 5 deletions
|
@ -123,11 +123,12 @@ void EventDispatcher::set_display_sleep(const bool sleep) {
|
|||
// TODO: Distribute display sleep message more broadly, shut down data generation
|
||||
// on baseband side, since all that data is being discarded during sleep.
|
||||
if( sleep ) {
|
||||
portapack::io.lcd_backlight(false);
|
||||
portapack::backlight()->off();
|
||||
portapack::display.sleep();
|
||||
} else {
|
||||
portapack::display.wake();
|
||||
portapack::io.lcd_backlight(true);
|
||||
// Don't turn on backlight here.
|
||||
// Let frame sync handler turn on backlight after repaint.
|
||||
}
|
||||
display_sleep = sleep;
|
||||
};
|
||||
|
@ -268,6 +269,8 @@ void EventDispatcher::handle_lcd_frame_sync() {
|
|||
DisplayFrameSyncMessage message;
|
||||
message_map.send(&message);
|
||||
painter.paint_widget_tree(top_widget);
|
||||
|
||||
portapack::backlight()->on();
|
||||
}
|
||||
|
||||
void EventDispatcher::handle_switches() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue