I spent some more time working on Ardudish documentation today. It’s a bit cathartic, and a bit ‘I told you so’. Well, maybe not as drastic as that. I guiltily acknowledge that creating documentation is a very important task for DURING a project. I feel bad for being so behind in documenting the project as a whole.
But I don’t want to just rant about some best practices! I’m pretty proud of the menu manager I’ve been working on and I want to try and package it as a more independent library. I’ve been using it on the dishwasher as well as a project at work, and there is a project I am planning that will make use of it with a few more features.
The current limitations of the menu manager are the single menu layer and function call only operation that it can implement. In other words, there is no menu hierarchy supported, and the menu can only call functions when prompted by the user. I would like to expand it in both directions.
Expanding Menu Manager
The first functionality I wanted to add was the ability to change a runtime parameter through the menu. This is a bread-and-butter feature of printer firmware. I haven’t dug too far into the details, but my initials thoughts see two competing implementations at the front.
Option 1: The user writes a variable update function for each variable they would like to be updatable. These functions can then be added to the menu as if it is any other function.
Option 2: The menu keeps a reference to the variable that the user has selected as updatable. The menu manager itself contains a generic update function that it internally calls when a menu item is a variable update function.
I can see advantages to both options and perhaps elements for both can be implemented and the user can select how they want to implement the menu manager.
The second functionality I wanted is the ability to have a hierarchy in the menu. The key part of the implementation will be the linking between the menus, or at least between menu items inside a single menu manager object. The statically assigned array menu doesn’t make much sense when hierarchy comes into play. It does make me want to put in some thought about whether a linked list implementation of the menu manager wouldn’t be better.
This has morphed from a work log into a bit of a design discussion, whoops.