1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Removed CMS menu guards when not debugging

This commit is contained in:
Martin Budden 2017-11-09 16:12:54 +00:00
parent 9a5cefbfa3
commit 243e8390a2
11 changed files with 58 additions and 1 deletions

View file

@ -209,8 +209,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 = cmsx_Blackbox_onEnter, .onEnter = cmsx_Blackbox_onEnter,
.onExit = cmsx_Blackbox_onExit, .onExit = cmsx_Blackbox_onExit,
.onGlobalExit = cmsx_Blackbox_FeatureWriteback, .onGlobalExit = cmsx_Blackbox_FeatureWriteback,

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

@ -161,8 +161,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,
@ -222,8 +224,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 = cmsx_RateProfileOnEnter, .onEnter = cmsx_RateProfileOnEnter,
.onExit = cmsx_RateProfileWriteback, .onExit = cmsx_RateProfileWriteback,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -291,8 +295,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,
@ -344,8 +350,10 @@ static OSD_Entry cmsx_menuFilterGlobalEntries[] =
}; };
static CMS_Menu cmsx_menuFilterGlobal = { static CMS_Menu cmsx_menuFilterGlobal = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XFLTGLB", .GUARD_text = "XFLTGLB",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = cmsx_menuGyro_onEnter, .onEnter = cmsx_menuGyro_onEnter,
.onExit = cmsx_menuGyro_onExit, .onExit = cmsx_menuGyro_onExit,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -395,8 +403,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 = cmsx_FilterPerProfileRead, .onEnter = cmsx_FilterPerProfileRead,
.onExit = cmsx_FilterPerProfileWriteback, .onExit = cmsx_FilterPerProfileWriteback,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -464,8 +474,10 @@ static OSD_Entry cmsx_menuCopyProfileEntries[] =
}; };
CMS_Menu cmsx_menuCopyProfile = { CMS_Menu cmsx_menuCopyProfile = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "XCPY", .GUARD_text = "XCPY",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = cmsx_menuCopyProfile_onEnter, .onEnter = cmsx_menuCopyProfile_onEnter,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -496,8 +508,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

@ -74,8 +74,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 = cmsx_Ledstrip_FeatureRead, .onEnter = cmsx_Ledstrip_FeatureRead,
.onExit = NULL, .onExit = NULL,
.onGlobalExit = cmsx_Ledstrip_FeatureWriteback, .onGlobalExit = cmsx_Ledstrip_FeatureWriteback,

View file

@ -82,8 +82,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,
@ -136,8 +138,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 = cmsx_menuMiscOnEnter, .onEnter = cmsx_menuMiscOnEnter,
.onExit = cmsx_menuMiscOnExit, .onExit = cmsx_menuMiscOnExit,
.onGlobalExit = NULL, .onGlobalExit = NULL,

View file

@ -103,8 +103,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,
@ -146,8 +148,10 @@ OSD_Entry menuAlarmsEntries[] =
}; };
CMS_Menu menuAlarms = { CMS_Menu menuAlarms = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUALARMS", .GUARD_text = "MENUALARMS",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = menuAlarmsOnEnter, .onEnter = menuAlarmsOnEnter,
.onExit = menuAlarmsOnExit, .onExit = menuAlarmsOnExit,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -197,8 +201,10 @@ OSD_Entry menuTimersEntries[] =
}; };
CMS_Menu menuTimers = { CMS_Menu menuTimers = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUTIMERS", .GUARD_text = "MENUTIMERS",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = menuTimersOnEnter, .onEnter = menuTimersOnEnter,
.onExit = menuTimersOnExit, .onExit = menuTimersOnExit,
.onGlobalExit = NULL, .onGlobalExit = NULL,
@ -254,8 +260,10 @@ OSD_Entry cmsx_menuOsdEntries[] =
}; };
CMS_Menu cmsx_menuOsd = { CMS_Menu cmsx_menuOsd = {
#ifdef CMS_MENU_DEBUG
.GUARD_text = "MENUOSD", .GUARD_text = "MENUOSD",
.GUARD_type = OME_MENU, .GUARD_type = OME_MENU,
#endif
.onEnter = cmsx_menuOsdOnEnter, .onEnter = cmsx_menuOsdOnEnter,
.onExit = cmsx_menuOsdOnExit, .onExit = cmsx_menuOsdOnExit,
.onGlobalExit = NULL, .onGlobalExit = NULL,

View file

@ -91,8 +91,10 @@ static OSD_Entry cmsx_menuVtxEntries[] =
}; };
CMS_Menu cmsx_menuVtxRTC6705 = { CMS_Menu cmsx_menuVtxRTC6705 = {
#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 = NULL, .onGlobalExit = NULL,

View file

@ -348,8 +348,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,
@ -514,8 +516,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,
@ -535,8 +539,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,
@ -559,8 +565,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,
@ -577,8 +585,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,
@ -642,8 +652,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

@ -191,8 +191,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,
@ -217,8 +219,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,

View file

@ -94,10 +94,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

@ -125,8 +125,10 @@ static OSD_Entry menuMainEntries[] =
{NULL, OME_END, NULL, NULL, 0} {NULL, OME_END, NULL, NULL, 0}
}; };
CMS_Menu menuMain = { CMS_Menu menuMain = {
#ifdef CMS_MENU_DEBUG
"MENUMAIN", "MENUMAIN",
OME_MENU, OME_MENU,
#endif
NULL, NULL,
NULL, NULL,
NULL, NULL,