mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-11-25 22:26:21 -05:00
fix some bugs due to framesync not fired on stealth mode (#2834)
This commit is contained in:
parent
dafe3b7641
commit
200831ad67
4 changed files with 28 additions and 27 deletions
|
|
@ -124,12 +124,12 @@ void EventDispatcher::request_stop() {
|
|||
|
||||
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.
|
||||
// on baseband side, since all that data is being discarded during sleep. -- DON'T TODO it, sincethe stealth mode want to send with screen off!
|
||||
if (sleep) {
|
||||
portapack::backlight()->off();
|
||||
portapack::display.sleep();
|
||||
portapack::display.sleep(false); // when called the hw_sleep = true, the irq wont fire, so the EVT_MASK_LCD_FRAME_SYNC won't set.
|
||||
} else {
|
||||
portapack::display.wake();
|
||||
portapack::display.wake(true); // not important, command not affect if already hw waken up
|
||||
// Don't turn on backlight here.
|
||||
// Let frame sync handler turn on backlight after repaint.
|
||||
}
|
||||
|
|
@ -180,12 +180,10 @@ void EventDispatcher::dispatch(const eventmask_t events) {
|
|||
/*if( events & EVT_MASK_LCD_FRAME_SYNC ) {
|
||||
blink_timer();
|
||||
}*/
|
||||
|
||||
if (events & EVT_MASK_LCD_FRAME_SYNC) {
|
||||
handle_lcd_frame_sync(!EventDispatcher::display_sleep);
|
||||
}
|
||||
if (!EventDispatcher::display_sleep) {
|
||||
if (events & EVT_MASK_LCD_FRAME_SYNC) {
|
||||
handle_lcd_frame_sync();
|
||||
}
|
||||
|
||||
if (events & EVT_MASK_ENCODER) {
|
||||
handle_encoder();
|
||||
}
|
||||
|
|
@ -328,17 +326,16 @@ ui::Widget* EventDispatcher::getFocusedWidget() {
|
|||
return context.focus_manager().focus_widget();
|
||||
}
|
||||
|
||||
void EventDispatcher::handle_lcd_frame_sync() {
|
||||
void EventDispatcher::handle_lcd_frame_sync(bool screen_on) {
|
||||
bool waiting_for_frame = this->waiting_for_frame;
|
||||
|
||||
DisplayFrameSyncMessage message;
|
||||
DisplayFrameSyncMessage message; // send framesync msg all the time, bc some apps relay on it
|
||||
message_map.send(&message);
|
||||
|
||||
static_cast<ui::SystemView*>(top_widget)->paint_overlay();
|
||||
painter.paint_widget_tree(top_widget);
|
||||
|
||||
portapack::backlight()->on();
|
||||
|
||||
if (screen_on) { // only draw when screen is on
|
||||
static_cast<ui::SystemView*>(top_widget)->paint_overlay();
|
||||
painter.paint_widget_tree(top_widget);
|
||||
portapack::backlight()->on();
|
||||
}
|
||||
if (waiting_for_frame)
|
||||
this->waiting_for_frame = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue