mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +03:00
Replace individual CMS vtx menus with a single entry that redirects to the correct protocol menu
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.
This commit is contained in:
parent
1c8d41b952
commit
5c98726318
19 changed files with 206 additions and 16 deletions
|
@ -654,6 +654,13 @@ long cmsMenuChange(displayPort_t *pDisplay, const void *ptr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (pMenu->checkRedirect) {
|
||||
const CMS_Menu *pRedirectMenu = (const CMS_Menu *)pMenu->checkRedirect();
|
||||
if (pRedirectMenu) {
|
||||
return cmsMenuChange(pDisplay, pRedirectMenu);
|
||||
}
|
||||
}
|
||||
|
||||
menuStack[menuStackIdx++] = currentCtx;
|
||||
|
||||
currentCtx.menu = pMenu;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue