Makes the invert, black brightness, and white brightness update the display as the settings are changed rather than only taking effect once the menu is exited.
Significantly reduces the time the OSD task spends drawing elements that are completely or mostly static. The larger the element the more time savings are realized. Currently implemented support for:
- Crosshairs
- Artificial Horizon Sidebars
- Craft name
- Display name
- Stick overlay
Since the static portions are only rendered once, the static elements add no processing time to the OSD task. As an example, enabling the above elements prior to these changes results in a total rendering time of 47us. After the enhancements they take only 6us (basically the rendering phase minimum overhead). So effectively 41us are removed from the OSD task.
Opens the possibility to add large mostly static elements with no additional overhead. An example would be a camera framing element that might draw a "box" around most of the screen. Previously this would add significant processing overhead to the OSD task, but now it will have no impact.
Instead of having individual menus for RTC6705, SmartAudio, and Tramp, Now there is a single VTX menu that detects the type of active device and redirects to the appropriate protocol menu.
Reduces confusion and chances of erroneously using the wrong VTX menu.
Fixes a problem where the Tramp menu could be used to change band/channel/power even though the VTX was a SmartAudio device.
If the VTX is not configured or not communicating, a more informative message will be presented rather than a partially populated protocol menu. For example:
```
VTX NOT RESPONDING
OR NOT CONFIGURED
> BACK
```
Extends the CMS menu capabilities by adding an optional `redirectCheck` function that can conditionally return a menu that should be redirected to instead of the current menu. This redirect happens before any processing happens for the original menu. Adds flexibility to make the CMS menus have a more dynamic aspect.
CMS menu items can now be defined with a `REBOOT_REQUIRED` flag. If the user changes flagged elements the the exit/save options will change to `EXIT&REBOOT` and `SAVE&REBOOT` - ensuring that the changed items will be handled properly. This should be used for options where runtime changes either won't take effect (because they are read at boot), or for items that could have unexpected behavior if changed.
Several appropriate menus have been updated to include the flag.
To accomodate the dynamic nature of the save/exit options, the individual options have been removed from the main menu and replaced with a `SAVE/EXIT` submenu. This is the same menu that is presented as the quick-access popup save menu (yaw-right). This menu will adapt to requiring a reboot if any flagged setting is changed. Additionally the `REBOOT_REQD` arming disabled reason will be set (cleared by the reboot).
After commit d2e7abd the for loop following my change use pageMaxRow to determine which flags to clear.
But this pageMaxRow value is updated after the loop, which caused a crash in a very specific circumstance:
1 open the CMS OSD menu and go to profile
2 close the profile by yaw right, select exit
3 open CMS OSD menu and go to profile again
This caused a crash as runtimeEntryFlags wasn't cleared properly and the Copy Profile entry's flags still indicated OPTSTRING somehow.
which caused it's CMSEntryFuncPtr function to be cast to OPTSTRING and called without arguments.
Remove the giant `select` block that contained all the code to generate the elements and transition them to individual functions called only when the element is active. Simplifies the code and results in a performance improvement as it's not necessary to fall through the large `select` statement for every element that will be drawn. The individual functions and the element to function mapping are moved to a new `osd_elements.c` file.
Moved the OSD related code files to a new `osd/` directory.
Also pre-analyze the active elements and only process those that are active. This also saves processing as it's not necessary to loop through all 50 or so elements when only a couple are active.
Various other cleanup and removal of stale or unnecessary code.
In the default configuration the element drawing phase of the OSD task is reduced from ~51us to ~35us - resulting in about a 30% decrease in processing time.
Previously the runtime page state was mixed with the page configuration.
This resolves this by:
a) making the configuration entries constant so they do not need to be
in RAM.
b) Maintaining page state independently.
The menu stack counter was not being reset when CMS was initially entered and multiple entries can cause an array overflow/memory corruption and wedge.
Previosuly the problem was accidentally prevented because the user was required to "back out" through the menus to exit which decremented the array index. However with the addition of the popup exit/save menu it became possible to exit without traversing back through the menu structure and this bug was exposed.
Adds a new exit/save menu that can be displayed at any time using the yaw-right stick command. Yaw-left still functions as "back".
Allows the user to save their settings even while nested deep in multiple menus. Previously the user was required to back up all the way to the top level menu to save or exit.