Replace individual CMS vtx menus with a single entry that redirects to the correct...
commit5c9872631893a8dcb6f7b55e959d594198c46302
authorBruce Luckcuck <github@etracer.net>
Sun, 20 Oct 2019 00:17:43 +0000 (19 20:17 -0400)
committerBruce Luckcuck <github@etracer.net>
Sun, 20 Oct 2019 00:17:43 +0000 (19 20:17 -0400)
tree846265ba45942982f9d40f880c0351dd43b2d4ea
parent1c8d41b952c18d6c760b0a9ab52adb24234b784c
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.
19 files changed:
make/source.mk
src/main/cms/cms.c
src/main/cms/cms_menu_blackbox.c
src/main/cms/cms_menu_builtin.c
src/main/cms/cms_menu_failsafe.c
src/main/cms/cms_menu_gps_rescue.c
src/main/cms/cms_menu_imu.c
src/main/cms/cms_menu_ledstrip.c
src/main/cms/cms_menu_misc.c
src/main/cms/cms_menu_osd.c
src/main/cms/cms_menu_power.c
src/main/cms/cms_menu_saveexit.c
src/main/cms/cms_menu_vtx_common.c [new file with mode: 0644]
src/main/cms/cms_menu_vtx_common.h [new file with mode: 0644]
src/main/cms/cms_menu_vtx_rtc6705.c
src/main/cms/cms_menu_vtx_smartaudio.c
src/main/cms/cms_menu_vtx_tramp.c
src/main/cms/cms_types.h
src/test/unit/cms_unittest.cc