Better home screen button handler
This commit is contained in:
@@ -18,6 +18,9 @@ The use of these gives a notion of "direction" when navigating the menu.
|
||||
|
||||
```
|
||||
|
||||
The downside of supporting transitions is that for these to work, the code should render the screen _first_ then return the new state.
|
||||
This ensures there is a good working copy in the buffer before the transition changes the view.
|
||||
|
||||
## TODO notes
|
||||
|
||||
On settings menu exit:
|
||||
|
||||
@@ -208,6 +208,6 @@ void startGUITask(void const *argument) {
|
||||
for (;;) {
|
||||
guiRenderLoop();
|
||||
resetWatchdog();
|
||||
vTaskDelayUntil(&startRender, TICKS_100MS / 2);
|
||||
vTaskDelayUntil(&startRender, TICKS_100MS / 2); // Try and maintain 20fps ish update rate, way to fast but if we can its nice
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,11 +167,6 @@ void drawSimplifiedHomeScreen(uint32_t tipTemp) {
|
||||
}
|
||||
OperatingMode drawHomeScreen(const ButtonState buttons, guiContext *cxt) {
|
||||
|
||||
OperatingMode newMode = handleHomeButtons(buttons, cxt);
|
||||
if (newMode != OperatingMode::HomeScreen) {
|
||||
return newMode;
|
||||
}
|
||||
|
||||
currentTempTargetDegC = 0; // ensure tip is off
|
||||
getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0);
|
||||
uint32_t tipTemp = TipThermoModel::getTipInC();
|
||||
@@ -187,6 +182,5 @@ OperatingMode drawHomeScreen(const ButtonState buttons, guiContext *cxt) {
|
||||
} else {
|
||||
drawSimplifiedHomeScreen(tipTemp);
|
||||
}
|
||||
|
||||
return OperatingMode::HomeScreen;
|
||||
return handleHomeButtons(buttons, cxt);
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
|
||||
// State 1 -> Root menu
|
||||
// State 2 -> Sub entry
|
||||
|
||||
return OperatingMode::SettingsMenu;
|
||||
return OperatingMode::HomeScreen;
|
||||
}
|
||||
Reference in New Issue
Block a user