Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Expected behavior: After editing a value the menu should return to the previous point with the same item previously selected.
Actual behavior: Either the top (back) item is selected, or the menu jumps up another level.
Causes: (1) Wrong arguments are being passed to
lcd_goto_menu
on click when editing a value. (2) Menus are just exiting withlcd_goto_menu
.Solution: (1) Pass the correct arguments to
lcd_goto_menu(prevMenu, ...)
to get feedback and set the encoder position. (2) Allow submenu (leaf) items to go back to origin. (3) Have all edit items go back to origin.Future considerations: It should be possible, adding a small array, to make a more general paging system, so a page can just go "up a level" when exiting and doesn't need an explicit
lcd_goto_menu
call. Also, the "back" label on a page could be determined by its parent, allowing more than one entry- and exit-point for a page.Naming conventions: It would be good to rename "menu" to "screen" or "page" and use that term in place of "menu" for those pages which aren't menu pages. This way we can think more generally about other kinds of pages, such as wizards, status screens, value editing pages, etc.