mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 01:35:35 +03:00
Combine BACK and END entries in CMS menus in a single item
As suggested by @hydra. OME_Back and OME_END continue to be valid items, but we now also have OME_BACK_AND_END which creates a back entry and indicates the end of the menu, saving an entry. On F3, this saves 464 bytes of flash.
This commit is contained in:
parent
826e339988
commit
3ba770c1e2
14 changed files with 69 additions and 89 deletions
|
@ -207,6 +207,9 @@ static void cmsUpdateMaxRow(displayPort_t *instance)
|
||||||
|
|
||||||
for (const OSD_Entry *ptr = pageTop; ptr->type != OME_END; ptr++) {
|
for (const OSD_Entry *ptr = pageTop; ptr->type != OME_END; ptr++) {
|
||||||
pageMaxRow++;
|
pageMaxRow++;
|
||||||
|
if (ptr->type == OME_BACK_AND_END) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pageMaxRow > MAX_MENU_ITEMS(instance)) {
|
if (pageMaxRow > MAX_MENU_ITEMS(instance)) {
|
||||||
|
@ -516,6 +519,7 @@ static int cmsDrawMenuEntry(displayPort_t *pDisplay, const OSD_Entry *p, uint8_t
|
||||||
case OME_OSD_Exit:
|
case OME_OSD_Exit:
|
||||||
case OME_END:
|
case OME_END:
|
||||||
case OME_Back:
|
case OME_Back:
|
||||||
|
case OME_BACK_AND_END:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OME_MENU:
|
case OME_MENU:
|
||||||
|
@ -592,8 +596,12 @@ static void cmsDrawMenu(displayPort_t *pDisplay, uint32_t currentTimeUs)
|
||||||
coloff += cmsElementIsLabel(p->type) ? 1 : 2;
|
coloff += cmsElementIsLabel(p->type) ? 1 : 2;
|
||||||
room -= displayWrite(pDisplay, coloff, i + top, p->text);
|
room -= displayWrite(pDisplay, coloff, i + top, p->text);
|
||||||
CLR_PRINTLABEL(p, i);
|
CLR_PRINTLABEL(p, i);
|
||||||
if (room < 30)
|
if (room < 30) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (p->type == OME_BACK_AND_END) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -605,8 +613,12 @@ static void cmsDrawMenu(displayPort_t *pDisplay, uint32_t currentTimeUs)
|
||||||
for (i = 0, p = pageTop; i < MAX_MENU_ITEMS(pDisplay) && p->type != OME_END; i++, p++) {
|
for (i = 0, p = pageTop; i < MAX_MENU_ITEMS(pDisplay) && p->type != OME_END; i++, p++) {
|
||||||
if (IS_PRINTVALUE(p, i)) {
|
if (IS_PRINTVALUE(p, i)) {
|
||||||
room -= cmsDrawMenuEntry(pDisplay, p, top + i, i);
|
room -= cmsDrawMenuEntry(pDisplay, p, top + i, i);
|
||||||
if (room < 30)
|
if (room < 30) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (p->type == OME_BACK_AND_END) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -614,7 +626,12 @@ static void cmsDrawMenu(displayPort_t *pDisplay, uint32_t currentTimeUs)
|
||||||
static void cmsMenuCountPage(displayPort_t *pDisplay)
|
static void cmsMenuCountPage(displayPort_t *pDisplay)
|
||||||
{
|
{
|
||||||
const OSD_Entry *p;
|
const OSD_Entry *p;
|
||||||
for (p = currentCtx.menu->entries; p->type != OME_END; p++);
|
for (p = currentCtx.menu->entries; p->type != OME_END; p++) {
|
||||||
|
if (p->type == OME_BACK_AND_END) {
|
||||||
|
p++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
pageCount = (p - currentCtx.menu->entries - 1) / MAX_MENU_ITEMS(pDisplay) + 1;
|
pageCount = (p - currentCtx.menu->entries - 1) / MAX_MENU_ITEMS(pDisplay) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -722,6 +739,9 @@ static void cmsTraverseGlobalExit(const CMS_Menu *pMenu)
|
||||||
if (p->type == OME_Submenu) {
|
if (p->type == OME_Submenu) {
|
||||||
cmsTraverseGlobalExit(p->data);
|
cmsTraverseGlobalExit(p->data);
|
||||||
}
|
}
|
||||||
|
if (p->type == OME_BACK_AND_END) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pMenu->onGlobalExit) {
|
if (pMenu->onGlobalExit) {
|
||||||
|
@ -866,6 +886,7 @@ STATIC_UNIT_TESTED uint16_t cmsHandleKey(displayPort_t *pDisplay, uint8_t key)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OME_Back:
|
case OME_Back:
|
||||||
|
case OME_BACK_AND_END:
|
||||||
cmsMenuBack(pDisplay);
|
cmsMenuBack(pDisplay);
|
||||||
res = BUTTON_PAUSE;
|
res = BUTTON_PAUSE;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -109,8 +109,7 @@ static const OSD_Entry menuBattSettingsEntries[]=
|
||||||
OSD_SETTING_ENTRY("CAP WARN", SETTING_BATTERY_CAPACITY_WARNING),
|
OSD_SETTING_ENTRY("CAP WARN", SETTING_BATTERY_CAPACITY_WARNING),
|
||||||
OSD_SETTING_ENTRY("CAP CRIT", SETTING_BATTERY_CAPACITY_CRITICAL),
|
OSD_SETTING_ENTRY("CAP CRIT", SETTING_BATTERY_CAPACITY_CRITICAL),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static CMS_Menu cmsx_menuBattSettings = {
|
static CMS_Menu cmsx_menuBattSettings = {
|
||||||
|
@ -134,8 +133,7 @@ static OSD_Entry menuBatteryEntries[]=
|
||||||
OSD_UINT8_CALLBACK_ENTRY("PROF", cmsx_onBatteryProfileIndexChange, (&(const OSD_UINT8_t){ &battDispProfileIndex, 1, MAX_BATTERY_PROFILE_COUNT, 1})),
|
OSD_UINT8_CALLBACK_ENTRY("PROF", cmsx_onBatteryProfileIndexChange, (&(const OSD_UINT8_t){ &battDispProfileIndex, 1, MAX_BATTERY_PROFILE_COUNT, 1})),
|
||||||
OSD_SUBMENU_ENTRY("SETTINGS", &cmsx_menuBattSettings),
|
OSD_SUBMENU_ENTRY("SETTINGS", &cmsx_menuBattSettings),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CMS_Menu cmsx_menuBattery = {
|
CMS_Menu cmsx_menuBattery = {
|
||||||
|
|
|
@ -86,8 +86,7 @@ static const OSD_Entry cmsx_menuBlackboxEntries[] =
|
||||||
OSD_FUNC_CALL_ENTRY("ERASE FLASH", cmsx_EraseFlash),
|
OSD_FUNC_CALL_ENTRY("ERASE FLASH", cmsx_EraseFlash),
|
||||||
#endif // USE_FLASHFS
|
#endif // USE_FLASHFS
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CMS_Menu cmsx_menuBlackbox = {
|
const CMS_Menu cmsx_menuBlackbox = {
|
||||||
|
|
|
@ -86,8 +86,7 @@ static const OSD_Entry menuInfoEntries[] = {
|
||||||
OSD_STRING_ENTRY("GITREV", infoGitRev),
|
OSD_STRING_ENTRY("GITREV", infoGitRev),
|
||||||
OSD_STRING_ENTRY("TARGET", infoTargetName),
|
OSD_STRING_ENTRY("TARGET", infoTargetName),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu menuInfo = {
|
static const CMS_Menu menuInfo = {
|
||||||
|
@ -128,8 +127,7 @@ static const OSD_Entry menuFeaturesEntries[] =
|
||||||
OSD_SUBMENU_ENTRY("LED STRIP", &cmsx_menuLedstrip),
|
OSD_SUBMENU_ENTRY("LED STRIP", &cmsx_menuLedstrip),
|
||||||
#endif // LED_STRIP
|
#endif // LED_STRIP
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu menuFeatures = {
|
static const CMS_Menu menuFeatures = {
|
||||||
|
|
|
@ -142,8 +142,7 @@ static const OSD_Entry cmsx_menuPidEntries[] =
|
||||||
OSD_UINT8_ENTRY("YAW I", (&(const OSD_UINT8_t){ &cmsx_pidYaw[1], 0, 200, 1 })),
|
OSD_UINT8_ENTRY("YAW I", (&(const OSD_UINT8_t){ &cmsx_pidYaw[1], 0, 200, 1 })),
|
||||||
OSD_UINT8_ENTRY("YAW D", (&(const OSD_UINT8_t){ &cmsx_pidYaw[2], 0, 200, 1 })),
|
OSD_UINT8_ENTRY("YAW D", (&(const OSD_UINT8_t){ &cmsx_pidYaw[2], 0, 200, 1 })),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuPid = {
|
static const CMS_Menu cmsx_menuPid = {
|
||||||
|
@ -198,8 +197,7 @@ static const OSD_Entry cmsx_menuPidAltMagEntries[] =
|
||||||
|
|
||||||
OSD_UINT8_ENTRY("MAG P", (&(const OSD_UINT8_t){ &cmsx_pidHead[0], 0, 255, 1 })),
|
OSD_UINT8_ENTRY("MAG P", (&(const OSD_UINT8_t){ &cmsx_pidHead[0], 0, 255, 1 })),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuPidAltMag = {
|
static const CMS_Menu cmsx_menuPidAltMag = {
|
||||||
|
@ -248,8 +246,7 @@ static const OSD_Entry cmsx_menuPidGpsnavEntries[] =
|
||||||
OSD_UINT8_ENTRY("POSR I", (&(const OSD_UINT8_t){ &cmsx_pidVelXY[1], 0, 255, 1 })),
|
OSD_UINT8_ENTRY("POSR I", (&(const OSD_UINT8_t){ &cmsx_pidVelXY[1], 0, 255, 1 })),
|
||||||
OSD_UINT8_ENTRY("POSR D", (&(const OSD_UINT8_t){ &cmsx_pidVelXY[2], 0, 255, 1 })),
|
OSD_UINT8_ENTRY("POSR D", (&(const OSD_UINT8_t){ &cmsx_pidVelXY[2], 0, 255, 1 })),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuPidGpsnav = {
|
static const CMS_Menu cmsx_menuPidGpsnav = {
|
||||||
|
@ -277,8 +274,7 @@ static const OSD_Entry cmsx_menuManualRateProfileEntries[] =
|
||||||
OSD_SETTING_ENTRY("MANU RC EXPO", SETTING_MANUAL_RC_EXPO),
|
OSD_SETTING_ENTRY("MANU RC EXPO", SETTING_MANUAL_RC_EXPO),
|
||||||
OSD_SETTING_ENTRY("MANU RC YAW EXP", SETTING_MANUAL_RC_YAW_EXPO),
|
OSD_SETTING_ENTRY("MANU RC YAW EXP", SETTING_MANUAL_RC_YAW_EXPO),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuManualRateProfile = {
|
static const CMS_Menu cmsx_menuManualRateProfile = {
|
||||||
|
@ -317,8 +313,7 @@ static const OSD_Entry cmsx_menuRateProfileEntries[] =
|
||||||
OSD_SETTING_ENTRY("THRPID ATT", SETTING_TPA_RATE),
|
OSD_SETTING_ENTRY("THRPID ATT", SETTING_TPA_RATE),
|
||||||
OSD_SETTING_ENTRY_STEP("TPA BRKPT", SETTING_TPA_BREAKPOINT, 10),
|
OSD_SETTING_ENTRY_STEP("TPA BRKPT", SETTING_TPA_BREAKPOINT, 10),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuRateProfile = {
|
static const CMS_Menu cmsx_menuRateProfile = {
|
||||||
|
@ -376,8 +371,7 @@ static const OSD_Entry cmsx_menuProfileOtherEntries[] = {
|
||||||
{ "HORZN STR", OME_UINT8, NULL, &(OSD_UINT8_t){ &cmsx_horizonStrength, 0, 200, 1 } , 0 },
|
{ "HORZN STR", OME_UINT8, NULL, &(OSD_UINT8_t){ &cmsx_horizonStrength, 0, 200, 1 } , 0 },
|
||||||
{ "HORZN TRS", OME_UINT8, NULL, &(OSD_UINT8_t){ &cmsx_horizonTransition, 0, 200, 1 } , 0 },
|
{ "HORZN TRS", OME_UINT8, NULL, &(OSD_UINT8_t){ &cmsx_horizonTransition, 0, 200, 1 } , 0 },
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuProfileOther = {
|
static const CMS_Menu cmsx_menuProfileOther = {
|
||||||
|
@ -404,8 +398,7 @@ static const OSD_Entry cmsx_menuFilterPerProfileEntries[] =
|
||||||
OSD_SETTING_ENTRY("YAW P LIM", SETTING_YAW_P_LIMIT),
|
OSD_SETTING_ENTRY("YAW P LIM", SETTING_YAW_P_LIMIT),
|
||||||
OSD_SETTING_ENTRY("YAW LPF", SETTING_YAW_LPF_HZ),
|
OSD_SETTING_ENTRY("YAW LPF", SETTING_YAW_LPF_HZ),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuFilterPerProfile = {
|
static const CMS_Menu cmsx_menuFilterPerProfile = {
|
||||||
|
@ -426,8 +419,7 @@ static const OSD_Entry cmsx_menuGyroEntries[] =
|
||||||
OSD_SETTING_ENTRY("GYRO SYNC", SETTING_GYRO_SYNC),
|
OSD_SETTING_ENTRY("GYRO SYNC", SETTING_GYRO_SYNC),
|
||||||
OSD_SETTING_ENTRY("GYRO LPF", SETTING_GYRO_HARDWARE_LPF),
|
OSD_SETTING_ENTRY("GYRO LPF", SETTING_GYRO_HARDWARE_LPF),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuGyro = {
|
static const CMS_Menu cmsx_menuGyro = {
|
||||||
|
@ -466,8 +458,7 @@ static const OSD_Entry cmsx_menuImuEntries[] =
|
||||||
{"FILT GLB", OME_Submenu, cmsMenuChange, &cmsx_menuFilterGlobal, 0},
|
{"FILT GLB", OME_Submenu, cmsMenuChange, &cmsx_menuFilterGlobal, 0},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CMS_Menu cmsx_menuImu = {
|
const CMS_Menu cmsx_menuImu = {
|
||||||
|
|
|
@ -60,8 +60,7 @@ static const OSD_Entry cmsx_menuLedstripEntries[] =
|
||||||
OSD_LABEL_ENTRY("-- LED STRIP --"),
|
OSD_LABEL_ENTRY("-- LED STRIP --"),
|
||||||
OSD_BOOL_FUNC_ENTRY("ENABLED", cmsx_FeatureLedStrip_Enabled),
|
OSD_BOOL_FUNC_ENTRY("ENABLED", cmsx_FeatureLedStrip_Enabled),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CMS_Menu cmsx_menuLedstrip = {
|
const CMS_Menu cmsx_menuLedstrip = {
|
||||||
|
|
|
@ -67,8 +67,7 @@ static const OSD_Entry cmsx_menuRcEntries[] =
|
||||||
OSD_INT16_RO_ENTRY("AUX3", &rcData[AUX3]),
|
OSD_INT16_RO_ENTRY("AUX3", &rcData[AUX3]),
|
||||||
OSD_INT16_RO_ENTRY("AUX4", &rcData[AUX4]),
|
OSD_INT16_RO_ENTRY("AUX4", &rcData[AUX4]),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuRcPreview = {
|
static const CMS_Menu cmsx_menuRcPreview = {
|
||||||
|
@ -94,8 +93,7 @@ static const OSD_Entry menuMiscEntries[]=
|
||||||
|
|
||||||
OSD_SUBMENU_ENTRY("RC PREV", &cmsx_menuRcPreview),
|
OSD_SUBMENU_ENTRY("RC PREV", &cmsx_menuRcPreview),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CMS_Menu cmsx_menuMisc = {
|
const CMS_Menu cmsx_menuMisc = {
|
||||||
|
|
|
@ -52,8 +52,7 @@ static const OSD_Entry cmsx_menuNavSettingsEntries[] =
|
||||||
OSD_SETTING_ENTRY("MID THR FOR AH", SETTING_NAV_USE_MIDTHR_FOR_ALTHOLD),
|
OSD_SETTING_ENTRY("MID THR FOR AH", SETTING_NAV_USE_MIDTHR_FOR_ALTHOLD),
|
||||||
OSD_SETTING_ENTRY("MC HOVER THR", SETTING_NAV_MC_HOVER_THR),
|
OSD_SETTING_ENTRY("MC HOVER THR", SETTING_NAV_MC_HOVER_THR),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuNavSettings = {
|
static const CMS_Menu cmsx_menuNavSettings = {
|
||||||
|
@ -83,8 +82,7 @@ static const CMS_Menu cmsx_menuNavSettings = {
|
||||||
OSD_SETTING_ENTRY("RTH ABORT THRES", SETTING_NAV_RTH_ABORT_THRESHOLD),
|
OSD_SETTING_ENTRY("RTH ABORT THRES", SETTING_NAV_RTH_ABORT_THRESHOLD),
|
||||||
OSD_SETTING_ENTRY("EMERG LANDING SPEED", SETTING_NAV_EMERG_LANDING_SPEED),
|
OSD_SETTING_ENTRY("EMERG LANDING SPEED", SETTING_NAV_EMERG_LANDING_SPEED),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuRTH = {
|
static const CMS_Menu cmsx_menuRTH = {
|
||||||
|
@ -111,8 +109,7 @@ static const OSD_Entry cmsx_menuFixedWingEntries[] =
|
||||||
OSD_SETTING_ENTRY("PITCH TO THR RATIO", SETTING_NAV_FW_PITCH2THR),
|
OSD_SETTING_ENTRY("PITCH TO THR RATIO", SETTING_NAV_FW_PITCH2THR),
|
||||||
OSD_SETTING_ENTRY("LOITER RADIUS", SETTING_NAV_FW_LOITER_RADIUS),
|
OSD_SETTING_ENTRY("LOITER RADIUS", SETTING_NAV_FW_LOITER_RADIUS),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuFixedWing = {
|
static const CMS_Menu cmsx_menuFixedWing = {
|
||||||
|
@ -134,8 +131,7 @@ static const OSD_Entry cmsx_menuNavigationEntries[] =
|
||||||
OSD_SUBMENU_ENTRY("RTH", &cmsx_menuRTH),
|
OSD_SUBMENU_ENTRY("RTH", &cmsx_menuRTH),
|
||||||
OSD_SUBMENU_ENTRY("FIXED WING", &cmsx_menuFixedWing),
|
OSD_SUBMENU_ENTRY("FIXED WING", &cmsx_menuFixedWing),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CMS_Menu cmsx_menuNavigation = {
|
const CMS_Menu cmsx_menuNavigation = {
|
||||||
|
|
|
@ -57,8 +57,7 @@ static const OSD_Entry cmsx_menuAlarmsEntries[] = {
|
||||||
OSD_SETTING_ENTRY("MAX DIST", SETTING_OSD_DIST_ALARM),
|
OSD_SETTING_ENTRY("MAX DIST", SETTING_OSD_DIST_ALARM),
|
||||||
OSD_SETTING_ENTRY("MAX NEG ALT", SETTING_OSD_NEG_ALT_ALARM),
|
OSD_SETTING_ENTRY("MAX NEG ALT", SETTING_OSD_NEG_ALT_ALARM),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuAlarms = {
|
static const CMS_Menu cmsx_menuAlarms = {
|
||||||
|
@ -101,8 +100,7 @@ static const OSD_Entry menuOsdElemActionsEntries[] = {
|
||||||
OSD_UINT8_CALLBACK_ENTRY("COLUMN", cmsx_osdElementOnChange, (&(const OSD_UINT8_t){ &osdCurrentElementColumn, 0, OSD_Y(OSD_POS_MAX), 1 })),
|
OSD_UINT8_CALLBACK_ENTRY("COLUMN", cmsx_osdElementOnChange, (&(const OSD_UINT8_t){ &osdCurrentElementColumn, 0, OSD_Y(OSD_POS_MAX), 1 })),
|
||||||
OSD_FUNC_CALL_ENTRY("PREVIEW", osdElementPreview),
|
OSD_FUNC_CALL_ENTRY("PREVIEW", osdElementPreview),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const OSD_Entry menuOsdFixedElemActionsEntries[] = {
|
static const OSD_Entry menuOsdFixedElemActionsEntries[] = {
|
||||||
|
@ -110,8 +108,7 @@ static const OSD_Entry menuOsdFixedElemActionsEntries[] = {
|
||||||
OSD_BOOL_CALLBACK_ENTRY("ENABLED", cmsx_osdElementOnChange, &osdCurrentElementVisible),
|
OSD_BOOL_CALLBACK_ENTRY("ENABLED", cmsx_osdElementOnChange, &osdCurrentElementVisible),
|
||||||
OSD_FUNC_CALL_ENTRY("PREVIEW", osdElementPreview),
|
OSD_FUNC_CALL_ENTRY("PREVIEW", osdElementPreview),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static CMS_Menu cmsx_menuOsdElementActions = {
|
static CMS_Menu cmsx_menuOsdElementActions = {
|
||||||
|
@ -261,15 +258,14 @@ static const OSD_Entry menuOsdElemsEntries[] =
|
||||||
OSD_ELEMENT_ENTRY("SENSOR 7 TEMP", OSD_TEMP_SENSOR_7_TEMPERATURE),
|
OSD_ELEMENT_ENTRY("SENSOR 7 TEMP", OSD_TEMP_SENSOR_7_TEMPERATURE),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(USE_GPS) && defined(USE_BARO) && defined(USE_PITOT) && defined(USE_TEMPERATURE_SENSOR)
|
#if defined(USE_GPS) && defined(USE_BARO) && defined(USE_PITOT) && defined(USE_TEMPERATURE_SENSOR)
|
||||||
// All CMS OSD elements should be enabled in this case. The menu has 3 extra
|
// All CMS OSD elements should be enabled in this case. The menu has 2 extra
|
||||||
// elements (label, back and end), but there's an OSD element that we intentionally
|
// elements (label, back+end), but there's an OSD element that we intentionally
|
||||||
// don't show here (OSD_DEBUG).
|
// don't show here (OSD_DEBUG).
|
||||||
_Static_assert(ARRAYLEN(menuOsdElemsEntries) - 3 + 1 == OSD_ITEM_COUNT, "missing OSD elements in CMS");
|
_Static_assert(ARRAYLEN(menuOsdElemsEntries) - 2 + 1 == OSD_ITEM_COUNT, "missing OSD elements in CMS");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const CMS_Menu menuOsdElements = {
|
const CMS_Menu menuOsdElements = {
|
||||||
|
@ -301,8 +297,7 @@ static const OSD_Entry cmsx_menuOsdLayoutEntries[] =
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CMS_Menu cmsx_menuOsdLayout = {
|
const CMS_Menu cmsx_menuOsdLayout = {
|
||||||
|
@ -344,9 +339,7 @@ static const OSD_Entry menuOsdSettingsEntries[] = {
|
||||||
OSD_SETTING_ENTRY("RIGHT SCROLL", SETTING_OSD_RIGHT_SIDEBAR_SCROLL),
|
OSD_SETTING_ENTRY("RIGHT SCROLL", SETTING_OSD_RIGHT_SIDEBAR_SCROLL),
|
||||||
OSD_SETTING_ENTRY("SCROLL ARROWS", SETTING_OSD_SIDEBAR_SCROLL_ARROWS),
|
OSD_SETTING_ENTRY("SCROLL ARROWS", SETTING_OSD_SIDEBAR_SCROLL_ARROWS),
|
||||||
|
|
||||||
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_BACK_ENTRY,
|
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu cmsx_menuOsdSettings = {
|
static const CMS_Menu cmsx_menuOsdSettings = {
|
||||||
|
@ -367,8 +360,7 @@ static const OSD_Entry menuOsdEntries[] = {
|
||||||
OSD_SUBMENU_ENTRY("SETTINGS", &cmsx_menuOsdSettings),
|
OSD_SUBMENU_ENTRY("SETTINGS", &cmsx_menuOsdSettings),
|
||||||
OSD_SUBMENU_ENTRY("ALARMS", &cmsx_menuAlarms),
|
OSD_SUBMENU_ENTRY("ALARMS", &cmsx_menuAlarms),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -128,8 +128,7 @@ static const OSD_Entry cmsx_menuVtxEntries[] =
|
||||||
OSD_BOOL_ENTRY("LOW POWER", &masterConfig.vtx_power),
|
OSD_BOOL_ENTRY("LOW POWER", &masterConfig.vtx_power),
|
||||||
#endif // USE_RTC6705
|
#endif // USE_RTC6705
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CMS_Menu cmsx_menuVtx = {
|
const CMS_Menu cmsx_menuVtx = {
|
||||||
|
|
|
@ -173,8 +173,7 @@ static const OSD_Entry ffpvCmsMenuCommenceEntries[] =
|
||||||
OSD_LABEL_ENTRY("CONFIRM"),
|
OSD_LABEL_ENTRY("CONFIRM"),
|
||||||
OSD_FUNC_CALL_ENTRY("YES", ffpvCmsCommence),
|
OSD_FUNC_CALL_ENTRY("YES", ffpvCmsCommence),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu ffpvCmsMenuCommence = {
|
static const CMS_Menu ffpvCmsMenuCommence = {
|
||||||
|
@ -199,8 +198,7 @@ static const OSD_Entry ffpvMenuEntries[] =
|
||||||
OSD_TAB_CALLBACK_ENTRY("POWER", ffpvCmsConfigPower, &ffpvCmsEntPower),
|
OSD_TAB_CALLBACK_ENTRY("POWER", ffpvCmsConfigPower, &ffpvCmsEntPower),
|
||||||
OSD_SUBMENU_ENTRY("SET", &ffpvCmsMenuCommence),
|
OSD_SUBMENU_ENTRY("SET", &ffpvCmsMenuCommence),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CMS_Menu cmsx_menuVtxFFPV = {
|
const CMS_Menu cmsx_menuVtxFFPV = {
|
||||||
|
|
|
@ -364,8 +364,7 @@ static const OSD_Entry saCmsMenuStatsEntries[] = {
|
||||||
OSD_UINT16_RO_ENTRY("CRCERR", &saStat.crc),
|
OSD_UINT16_RO_ENTRY("CRCERR", &saStat.crc),
|
||||||
OSD_UINT16_RO_ENTRY("OOOERR", &saStat.ooopresp),
|
OSD_UINT16_RO_ENTRY("OOOERR", &saStat.ooopresp),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu saCmsMenuStats = {
|
static const CMS_Menu saCmsMenuStats = {
|
||||||
|
@ -547,8 +546,7 @@ static const OSD_Entry saCmsMenuPORFreqEntries[] =
|
||||||
OSD_UINT16_ENTRY("NEW FREQ", (&(const OSD_UINT16_t){ &saCmsORFreqNew, 5000, 5900, 1 })),
|
OSD_UINT16_ENTRY("NEW FREQ", (&(const OSD_UINT16_t){ &saCmsORFreqNew, 5000, 5900, 1 })),
|
||||||
OSD_FUNC_CALL_ENTRY("SET", saCmsSetPORFreq),
|
OSD_FUNC_CALL_ENTRY("SET", saCmsSetPORFreq),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu saCmsMenuPORFreq =
|
static const CMS_Menu saCmsMenuPORFreq =
|
||||||
|
@ -571,8 +569,7 @@ static const OSD_Entry saCmsMenuUserFreqEntries[] =
|
||||||
OSD_UINT16_ENTRY("NEW FREQ", (&(const OSD_UINT16_t){ &saCmsUserFreqNew, 5000, 5900, 1 })),
|
OSD_UINT16_ENTRY("NEW FREQ", (&(const OSD_UINT16_t){ &saCmsUserFreqNew, 5000, 5900, 1 })),
|
||||||
OSD_FUNC_CALL_ENTRY("SET", saCmsConfigUserFreq),
|
OSD_FUNC_CALL_ENTRY("SET", saCmsConfigUserFreq),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu saCmsMenuUserFreq =
|
static const CMS_Menu saCmsMenuUserFreq =
|
||||||
|
@ -601,8 +598,7 @@ static const OSD_Entry saCmsMenuConfigEntries[] =
|
||||||
OSD_SUBMENU_ENTRY("STATX", &saCmsMenuStats),
|
OSD_SUBMENU_ENTRY("STATX", &saCmsMenuStats),
|
||||||
#endif /* USE_EXTENDED_CMS_MENUS */
|
#endif /* USE_EXTENDED_CMS_MENUS */
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu saCmsMenuConfig = {
|
static const CMS_Menu saCmsMenuConfig = {
|
||||||
|
@ -621,8 +617,7 @@ static const OSD_Entry saCmsMenuCommenceEntries[] =
|
||||||
OSD_LABEL_ENTRY("CONFIRM"),
|
OSD_LABEL_ENTRY("CONFIRM"),
|
||||||
OSD_FUNC_CALL_ENTRY("YES", saCmsCommence),
|
OSD_FUNC_CALL_ENTRY("YES", saCmsCommence),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu saCmsMenuCommence = {
|
static const CMS_Menu saCmsMenuCommence = {
|
||||||
|
@ -651,8 +646,7 @@ static const OSD_Entry saCmsMenuFreqModeEntries[] =
|
||||||
OSD_SUBMENU_ENTRY("SET", &saCmsMenuCommence),
|
OSD_SUBMENU_ENTRY("SET", &saCmsMenuCommence),
|
||||||
OSD_SUBMENU_ENTRY("CONFIG", &saCmsMenuConfig),
|
OSD_SUBMENU_ENTRY("CONFIG", &saCmsMenuConfig),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
|
@ -668,8 +662,7 @@ static const OSD_Entry saCmsMenuChanModeEntries[] =
|
||||||
OSD_SUBMENU_ENTRY("SET", &saCmsMenuCommence),
|
OSD_SUBMENU_ENTRY("SET", &saCmsMenuCommence),
|
||||||
OSD_SUBMENU_ENTRY("CONFIG", &saCmsMenuConfig),
|
OSD_SUBMENU_ENTRY("CONFIG", &saCmsMenuConfig),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const OSD_Entry saCmsMenuOfflineEntries[] =
|
static const OSD_Entry saCmsMenuOfflineEntries[] =
|
||||||
|
@ -681,8 +674,7 @@ static const OSD_Entry saCmsMenuOfflineEntries[] =
|
||||||
OSD_SUBMENU_ENTRY("STATX", &saCmsMenuStats),
|
OSD_SUBMENU_ENTRY("STATX", &saCmsMenuStats),
|
||||||
#endif /* USE_EXTENDED_CMS_MENUS */
|
#endif /* USE_EXTENDED_CMS_MENUS */
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CMS_Menu cmsx_menuVtxSmartAudio; // Forward
|
CMS_Menu cmsx_menuVtxSmartAudio; // Forward
|
||||||
|
|
|
@ -211,8 +211,7 @@ static const OSD_Entry trampCmsMenuCommenceEntries[] =
|
||||||
OSD_LABEL_ENTRY("CONFIRM"),
|
OSD_LABEL_ENTRY("CONFIRM"),
|
||||||
OSD_FUNC_CALL_ENTRY("YES", trampCmsCommence),
|
OSD_FUNC_CALL_ENTRY("YES", trampCmsCommence),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const CMS_Menu trampCmsMenuCommence = {
|
static const CMS_Menu trampCmsMenuCommence = {
|
||||||
|
@ -239,8 +238,7 @@ static const OSD_Entry trampMenuEntries[] =
|
||||||
OSD_INT16_RO_ENTRY("T(C)", &trampData.temperature),
|
OSD_INT16_RO_ENTRY("T(C)", &trampData.temperature),
|
||||||
OSD_SUBMENU_ENTRY("SET", &trampCmsMenuCommence),
|
OSD_SUBMENU_ENTRY("SET", &trampCmsMenuCommence),
|
||||||
|
|
||||||
OSD_BACK_ENTRY,
|
OSD_BACK_AND_END_ENTRY,
|
||||||
OSD_END_ENTRY,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CMS_Menu cmsx_menuVtxTramp = {
|
const CMS_Menu cmsx_menuVtxTramp = {
|
||||||
|
|
|
@ -46,6 +46,7 @@ typedef enum
|
||||||
//wlasciwosci elementow
|
//wlasciwosci elementow
|
||||||
OME_TAB,
|
OME_TAB,
|
||||||
OME_END,
|
OME_END,
|
||||||
|
OME_BACK_AND_END,
|
||||||
|
|
||||||
// Debug aid
|
// Debug aid
|
||||||
OME_MENU,
|
OME_MENU,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue