1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 01:35:35 +03:00

Made inclusion of CMS guard conditional on debug flag

This commit is contained in:
Martin Budden 2017-11-20 09:02:23 +00:00
parent 1833bfd374
commit a8efd77d73
11 changed files with 66 additions and 3 deletions

View file

@ -89,8 +89,10 @@ static OSD_Entry cmsx_menuBlackboxEntries[] =
}; };
CMS_Menu cmsx_menuBlackbox = { CMS_Menu cmsx_menuBlackbox = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUBB", .GUARD_text = "MENUBB",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,

View file

@ -81,8 +81,10 @@ static OSD_Entry menuInfoEntries[] = {
}; };
static CMS_Menu menuInfo = { static CMS_Menu menuInfo = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUINFO", .GUARD_text = "MENUINFO",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = cmsx_InfoInit, .onEnter = cmsx_InfoInit,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -117,8 +119,10 @@ static OSD_Entry menuFeaturesEntries[] =
}; };
static CMS_Menu menuFeatures = { static CMS_Menu menuFeatures = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUFEATURES", .GUARD_text = "MENUFEATURES",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -149,8 +153,10 @@ static OSD_Entry menuMainEntries[] =
}; };
CMS_Menu menuMain = { CMS_Menu menuMain = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUMAIN", .GUARD_text = "MENUMAIN",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,

View file

@ -150,8 +150,10 @@ static OSD_Entry cmsx_menuPidEntries[] =
}; };
static CMS_Menu cmsx_menuPid = { static CMS_Menu cmsx_menuPid = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XPID", .GUARD_text = "XPID",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = cmsx_PidOnEnter, .onEnter = cmsx_PidOnEnter,
.onExit = cmsx_PidWriteback, .onExit = cmsx_PidWriteback,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -200,8 +202,10 @@ static OSD_Entry cmsx_menuPidAltMagEntries[] = {
}; };
static CMS_Menu cmsx_menuPidAltMag = { static CMS_Menu cmsx_menuPidAltMag = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XALTMAG", .GUARD_text = "XALTMAG",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = cmsx_menuPidAltMag_onEnter, .onEnter = cmsx_menuPidAltMag_onEnter,
.onExit = cmsx_menuPidAltMag_onExit, .onExit = cmsx_menuPidAltMag_onExit,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -245,8 +249,10 @@ static OSD_Entry cmsx_menuPidGpsnavEntries[] = {
}; };
static CMS_Menu cmsx_menuPidGpsnav = { static CMS_Menu cmsx_menuPidGpsnav = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XGPSNAV", .GUARD_text = "XGPSNAV",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = cmsx_menuPidGpsnav_onEnter, .onEnter = cmsx_menuPidGpsnav_onEnter,
.onExit = cmsx_menuPidGpsnav_onExit, .onExit = cmsx_menuPidGpsnav_onExit,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -283,8 +289,10 @@ static OSD_Entry cmsx_menuRateProfileEntries[] =
}; };
static CMS_Menu cmsx_menuRateProfile = { static CMS_Menu cmsx_menuRateProfile = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENURATE", .GUARD_text = "MENURATE",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -340,8 +348,10 @@ static OSD_Entry cmsx_menuProfileOtherEntries[] = {
}; };
static CMS_Menu cmsx_menuProfileOther = { static CMS_Menu cmsx_menuProfileOther = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XPROFOTHER", .GUARD_text = "XPROFOTHER",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = cmsx_profileOtherOnEnter, .onEnter = cmsx_profileOtherOnEnter,
.onExit = cmsx_profileOtherOnExit, .onExit = cmsx_profileOtherOnExit,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -366,8 +376,10 @@ static OSD_Entry cmsx_menuFilterPerProfileEntries[] =
}; };
static CMS_Menu cmsx_menuFilterPerProfile = { static CMS_Menu cmsx_menuFilterPerProfile = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XFLTPP", .GUARD_text = "XFLTPP",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -387,8 +399,10 @@ static OSD_Entry cmsx_menuGyroEntries[] =
}; };
static CMS_Menu cmsx_menuGyro = { static CMS_Menu cmsx_menuGyro = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XGYROGLB", .GUARD_text = "XGYROGLB",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -424,8 +438,10 @@ static OSD_Entry cmsx_menuImuEntries[] =
}; };
CMS_Menu cmsx_menuImu = { CMS_Menu cmsx_menuImu = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XIMU", .GUARD_text = "XIMU",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = cmsx_menuImu_onEnter, .onEnter = cmsx_menuImu_onEnter,
.onExit = cmsx_menuImu_onExit, .onExit = cmsx_menuImu_onExit,
.onGlobalExit = NULL, .onGlobalExit = NULL,

View file

@ -66,8 +66,10 @@ static OSD_Entry cmsx_menuLedstripEntries[] =
}; };
CMS_Menu cmsx_menuLedstrip = { CMS_Menu cmsx_menuLedstrip = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENULED", .GUARD_text = "MENULED",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,

View file

@ -71,8 +71,10 @@ static OSD_Entry cmsx_menuRcEntries[] =
}; };
CMS_Menu cmsx_menuRcPreview = { CMS_Menu cmsx_menuRcPreview = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XRCPREV", .GUARD_text = "XRCPREV",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = cmsx_menuRcConfirmBack, .onExit = cmsx_menuRcConfirmBack,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -96,8 +98,10 @@ static OSD_Entry menuMiscEntries[]=
}; };
CMS_Menu cmsx_menuMisc = { CMS_Menu cmsx_menuMisc = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XMISC", .GUARD_text = "XMISC",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,

View file

@ -54,8 +54,10 @@ static OSD_Entry cmsx_menuNavSettingsEntries[] =
}; };
static CMS_Menu cmsx_menuNavSettings = { static CMS_Menu cmsx_menuNavSettings = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUNAVSETTINGS", .GUARD_text = "MENUNAVSETTINGS",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -81,8 +83,10 @@ static CMS_Menu cmsx_menuNavSettings = {
}; };
static CMS_Menu cmsx_menuRTH = { static CMS_Menu cmsx_menuRTH = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUNAVRTH", .GUARD_text = "MENUNAVRTH",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -105,8 +109,10 @@ static OSD_Entry cmsx_menuFixedWingEntries[] =
}; };
static CMS_Menu cmsx_menuFixedWing = { static CMS_Menu cmsx_menuFixedWing = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUNAVFW", .GUARD_text = "MENUNAVFW",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -124,12 +130,14 @@ static OSD_Entry cmsx_menuNavigationEntries[] =
}; };
CMS_Menu cmsx_menuNavigation = { CMS_Menu cmsx_menuNavigation = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUNAV", .GUARD_text = "MENUNAV",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
.entries = cmsx_menuNavigationEntries .entries = cmsx_menuNavigationEntries
}; };
#endif #endif

View file

@ -47,8 +47,10 @@ OSD_Entry cmsx_menuAlarmsEntries[] =
}; };
CMS_Menu cmsx_menuAlarms = { CMS_Menu cmsx_menuAlarms = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUALARMS", .GUARD_text = "MENUALARMS",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -108,8 +110,10 @@ OSD_Entry menuOsdActiveElemsEntries[] =
}; };
CMS_Menu menuOsdActiveElems = { CMS_Menu menuOsdActiveElems = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUOSDACT", .GUARD_text = "MENUOSDACT",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = menuOsdActiveElemsOnEnter, .onEnter = menuOsdActiveElemsOnEnter,
.onExit = menuOsdActiveElemsOnExit, .onExit = menuOsdActiveElemsOnExit,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -125,8 +129,10 @@ OSD_Entry cmsx_menuOsdLayoutEntries[] =
}; };
CMS_Menu cmsx_menuOsdLayout = { CMS_Menu cmsx_menuOsdLayout = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENULAYOUT", .GUARD_text = "MENULAYOUT",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,

View file

@ -132,8 +132,10 @@ static OSD_Entry cmsx_menuVtxEntries[] =
}; };
CMS_Menu cmsx_menuVtx = { CMS_Menu cmsx_menuVtx = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUVTX", .GUARD_text = "MENUVTX",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = cmsx_Vtx_onEnter, .onEnter = cmsx_Vtx_onEnter,
.onExit= cmsx_Vtx_onExit, .onExit= cmsx_Vtx_onExit,
.onGlobalExit = cmsx_Vtx_FeatureWriteback, .onGlobalExit = cmsx_Vtx_FeatureWriteback,

View file

@ -61,7 +61,7 @@ typedef long (*CMSEntryFuncPtr)(displayPort_t *displayPort, const void *ptr);
typedef struct typedef struct
{ {
const char *text; const char * const text;
const OSD_MenuElement type; const OSD_MenuElement type;
const CMSEntryFuncPtr func; const CMSEntryFuncPtr func;
void *data; void *data;
@ -110,10 +110,11 @@ typedef long (*CMSMenuOnExitPtr)(const OSD_Entry *self);
typedef struct typedef struct
{ {
#ifdef CMS_MENU_DEBUG
// These two are debug aids for menu content creators. // These two are debug aids for menu content creators.
const char *GUARD_text; const char *GUARD_text;
const OSD_MenuElement GUARD_type; const OSD_MenuElement GUARD_type;
#endif
const CMSMenuFuncPtr onEnter; const CMSMenuFuncPtr onEnter;
const CMSMenuOnExitPtr onExit; const CMSMenuOnExitPtr onExit;
const CMSMenuFuncPtr onGlobalExit; const CMSMenuFuncPtr onGlobalExit;

View file

@ -1130,8 +1130,10 @@ static OSD_Entry saCmsMenuStatsEntries[] = {
}; };
static CMS_Menu saCmsMenuStats = { static CMS_Menu saCmsMenuStats = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XSAST", .GUARD_text = "XSAST",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -1294,8 +1296,10 @@ static OSD_Entry saCmsMenuPORFreqEntries[] = {
static CMS_Menu saCmsMenuPORFreq = static CMS_Menu saCmsMenuPORFreq =
{ {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XSAPOR", .GUARD_text = "XSAPOR",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = saCmsSetPORFreqOnEnter, .onEnter = saCmsSetPORFreqOnEnter,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -1315,8 +1319,10 @@ static OSD_Entry saCmsMenuUserFreqEntries[] = {
static CMS_Menu saCmsMenuUserFreq = static CMS_Menu saCmsMenuUserFreq =
{ {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XSAUFQ", .GUARD_text = "XSAUFQ",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = saCmsSetUserFreqOnEnter, .onEnter = saCmsSetUserFreqOnEnter,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -1339,8 +1345,10 @@ static OSD_Entry saCmsMenuConfigEntries[] = {
}; };
static CMS_Menu saCmsMenuConfig = { static CMS_Menu saCmsMenuConfig = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XSACFG", .GUARD_text = "XSACFG",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -1357,8 +1365,10 @@ static OSD_Entry saCmsMenuCommenceEntries[] = {
}; };
static CMS_Menu saCmsMenuCommence = { static CMS_Menu saCmsMenuCommence = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XVTXCOM", .GUARD_text = "XVTXCOM",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -1422,8 +1432,10 @@ static long sacms_SetupTopMenu(void)
} }
CMS_Menu cmsx_menuVtxSmartAudio = { CMS_Menu cmsx_menuVtxSmartAudio = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XVTXSA", .GUARD_text = "XVTXSA",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = sacms_SetupTopMenu, .onEnter = sacms_SetupTopMenu,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,

View file

@ -591,8 +591,10 @@ static OSD_Entry trampCmsMenuCommenceEntries[] = {
}; };
static CMS_Menu trampCmsMenuCommence = { static CMS_Menu trampCmsMenuCommence = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XVTXTRC", .GUARD_text = "XVTXTRC",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = NULL, .onEnter = NULL,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -617,8 +619,10 @@ static OSD_Entry trampMenuEntries[] =
}; };
CMS_Menu cmsx_menuVtxTramp = { CMS_Menu cmsx_menuVtxTramp = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XVTXTR", .GUARD_text = "XVTXTR",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = trampCmsOnEnter, .onEnter = trampCmsOnEnter,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,