Fixup settings acceleration
This commit is contained in:
@@ -24,7 +24,13 @@ The use of these gives a notion of "direction" when navigating the menu.
|
||||
│Soldering Mode│ │ │ │ │ │ │
|
||||
│ OR ├───────────┤Home Menu ├───────────┤Settings Main Menu├───────────┤Settings sub menu│
|
||||
│Reflow Mode│ │ │ │ │ │ │
|
||||
└──────────────┘ └──────────┘ └──────────────────┘ └─────────────────┘
|
||||
└──────────────┘ └──────────┘ └──────────────────┘ └─────────┬───────┘
|
||||
│
|
||||
┌─────────┴───────┐
|
||||
│ │
|
||||
│Settings sub menu│
|
||||
│ │
|
||||
└─────────────────┘
|
||||
```
|
||||
|
||||
The downside of supporting transitions is that for these to work, the code should render the screen _first_ then return the new state.
|
||||
|
||||
@@ -170,7 +170,7 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
|
||||
case BUTTON_F_LONG:
|
||||
if (xTaskGetTickCount() + (*autoRepeatAcceleration) > (*autoRepeatTimer) + PRESS_ACCEL_INTERVAL_MAX) {
|
||||
if (callIncrementHandler()) {
|
||||
(*autoRepeatTimer) = 1000;
|
||||
(*autoRepeatTimer) = TICKS_SECOND * 2;
|
||||
} else {
|
||||
(*autoRepeatTimer) = 0;
|
||||
}
|
||||
@@ -212,6 +212,9 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ((PRESS_ACCEL_INTERVAL_MAX - (*autoRepeatAcceleration)) < PRESS_ACCEL_INTERVAL_MIN) {
|
||||
(*autoRepeatAcceleration) = PRESS_ACCEL_INTERVAL_MAX - PRESS_ACCEL_INTERVAL_MIN;
|
||||
}
|
||||
|
||||
// Otherwise we stay put for next render iteration
|
||||
return newMode;
|
||||
|
||||
Reference in New Issue
Block a user