UI: remove screen refresh flag

screen refresh is not needed anymore since GUI refresh is already done on demand
replace/03e85f763cba897b1f636643191c1a41d964aafd
Federico Amedeo Izzo 2021-01-01 21:11:22 +01:00
rodzic 08087cb14a
commit 89567cce85
3 zmienionych plików z 13 dodań i 30 usunięć

Wyświetl plik

@ -66,9 +66,8 @@ void ui_updateFSM(event_t event, bool *sync_rtx);
/**
* This function redraws the GUI based on the last radio state.
* @param last_state: A local copy of the previous radio state
* @return true if a screen refresh is needed after the update
*/
bool ui_updateGUI(state_t last_state);
void ui_updateGUI(state_t last_state);
/**
* This function terminates the User Interface.

Wyświetl plik

@ -127,15 +127,11 @@ static void ui_task(void *arg)
}
// Redraw GUI based on last state copy
bool renderNeeded = ui_updateGUI(last_state);
if(renderNeeded)
{
// Lock display mutex and render display
OSMutexPend(&display_mutex, 0u, OS_OPT_PEND_BLOCKING, 0u, &os_err);
gfx_render();
OSMutexPost(&display_mutex, OS_OPT_POST_NONE, &os_err);
}
ui_updateGUI(last_state);
// Lock display mutex and render display
OSMutexPend(&display_mutex, 0u, OS_OPT_PEND_BLOCKING, 0u, &os_err);
gfx_render();
OSMutexPost(&display_mutex, OS_OPT_POST_NONE, &os_err);
// We don't need a delay because we lock on incoming events
// TODO: Enable self refresh when a continuous visualization is enabled

Wyświetl plik

@ -448,26 +448,22 @@ void _ui_drawMenuList(point_t pos, const char *entries[],
}
}
bool _ui_drawVFOMain(state_t* last_state)
void _ui_drawVFOMain(state_t* last_state)
{
gfx_clearScreen();
_ui_drawVFOBackground();
_ui_drawVFOTop(last_state);
_ui_drawVFOMiddle(last_state);
_ui_drawVFOBottom();
bool screen_update = true;
return screen_update;
}
bool _ui_drawVFOInput(state_t* last_state)
void _ui_drawVFOInput(state_t* last_state)
{
gfx_clearScreen();
_ui_drawVFOBackground();
_ui_drawVFOTop(last_state);
_ui_drawVFOMiddleInput(last_state);
_ui_drawVFOBottom();
bool screen_update = true;
return screen_update;
}
void _ui_drawMenuTop()
@ -573,7 +569,7 @@ void ui_drawSplashScreen()
#endif
}
bool _ui_drawLowBatteryScreen()
void _ui_drawLowBatteryScreen()
{
gfx_clearScreen();
uint16_t bat_width = SCREEN_WIDTH / 2;
@ -593,7 +589,6 @@ bool _ui_drawLowBatteryScreen()
FONT_SIZE_6PT,
TEXT_ALIGN_CENTER,
color_white);
return true;
}
freq_t _ui_freq_add_digit(freq_t freq, uint8_t pos, uint8_t number)
@ -942,54 +937,47 @@ void ui_updateFSM(event_t event, bool *sync_rtx)
}
}
bool ui_updateGUI(state_t last_state)
void ui_updateGUI(state_t last_state)
{
if(!layout_ready)
{
layout = _ui_calculateLayout();
layout_ready = true;
}
// TODO: Improve screen_update logic
bool screen_update = false;
// Draw current GUI page
switch(last_state.ui_screen)
{
// VFO main screen
case VFO_MAIN:
screen_update = _ui_drawVFOMain(&last_state);
_ui_drawVFOMain(&last_state);
break;
// VFO frequency input screen
case VFO_INPUT:
screen_update = _ui_drawVFOInput(&last_state);
_ui_drawVFOInput(&last_state);
break;
// Top menu screen
case MENU_TOP:
_ui_drawMenuTop();
screen_update = true;
break;
// Settings menu screen
case MENU_SETTINGS:
_ui_drawMenuSettings();
screen_update = true;
break;
#ifdef HAS_RTC
// Time&Date settings screen
case SETTINGS_TIMEDATE:
_ui_drawSettingsTimeDate(&last_state);
screen_update = true;
break;
// Time&Date settings screen, edit mode
case SETTINGS_TIMEDATE_SET:
_ui_drawSettingsTimeDateSet(&last_state);
screen_update = true;
break;
#endif
// Low battery screen
case LOW_BAT:
screen_update = _ui_drawLowBatteryScreen();
_ui_drawLowBatteryScreen();
break;
}
return screen_update;
}
void ui_terminate()