mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 13:25:30 +03:00
Added calibration menu to CMS.
This commit is contained in:
parent
c6e5882dd9
commit
cedcf2d7e2
41 changed files with 387 additions and 143 deletions
132
src/main/cms/cms_menu_main.c
Normal file
132
src/main/cms/cms_menu_main.c
Normal file
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
* This file is part of Cleanflight and Betaflight.
|
||||
*
|
||||
* Cleanflight and Betaflight are free software. You can redistribute
|
||||
* this software and/or modify this software under the terms of the
|
||||
* GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Cleanflight and Betaflight are distributed in the hope that they
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software.
|
||||
*
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
//
|
||||
// Main menu structure and support functions
|
||||
//
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef USE_CMS
|
||||
|
||||
#include "cms/cms.h"
|
||||
#include "cms/cms_types.h"
|
||||
|
||||
// Sub menus
|
||||
|
||||
#include "cms/cms_menu_imu.h"
|
||||
#include "cms/cms_menu_blackbox.h"
|
||||
#include "cms/cms_menu_failsafe.h"
|
||||
#include "cms/cms_menu_firmware.h"
|
||||
#include "cms/cms_menu_ledstrip.h"
|
||||
#include "cms/cms_menu_misc.h"
|
||||
#include "cms/cms_menu_osd.h"
|
||||
#include "cms/cms_menu_power.h"
|
||||
#include "cms/cms_menu_saveexit.h"
|
||||
|
||||
// VTX supplied menus
|
||||
|
||||
#include "cms/cms_menu_vtx_common.h"
|
||||
|
||||
#include "config/config.h"
|
||||
|
||||
#include "cms_menu_main.h"
|
||||
|
||||
|
||||
// Features
|
||||
|
||||
static const OSD_Entry menuFeaturesEntries[] =
|
||||
{
|
||||
{"--- FEATURES ---", OME_Label, NULL, NULL, 0},
|
||||
|
||||
#if defined(USE_BLACKBOX)
|
||||
{"BLACKBOX", OME_Submenu, cmsMenuChange, &cmsx_menuBlackbox, 0},
|
||||
#endif
|
||||
#if defined(USE_VTX_CONTROL)
|
||||
#if defined(USE_VTX_RTC6705) || defined(USE_VTX_SMARTAUDIO) || defined(USE_VTX_TRAMP)
|
||||
{"VTX", OME_Submenu, cmsMenuChange, &cmsx_menuVtxRedirect, 0},
|
||||
#endif
|
||||
#endif // VTX_CONTROL
|
||||
#ifdef USE_LED_STRIP
|
||||
{"LED STRIP", OME_Submenu, cmsMenuChange, &cmsx_menuLedstrip, 0},
|
||||
#endif // LED_STRIP
|
||||
{"POWER", OME_Submenu, cmsMenuChange, &cmsx_menuPower, 0},
|
||||
#ifdef USE_CMS_FAILSAFE_MENU
|
||||
{"FAILSAFE", OME_Submenu, cmsMenuChange, &cmsx_menuFailsafe, 0},
|
||||
#endif
|
||||
{"BACK", OME_Back, NULL, NULL, 0},
|
||||
{NULL, OME_END, NULL, NULL, 0}
|
||||
};
|
||||
|
||||
static CMS_Menu cmsx_menuFeatures = {
|
||||
#ifdef CMS_MENU_DEBUG
|
||||
.GUARD_text = "MENUFEATURES",
|
||||
.GUARD_type = OME_MENU,
|
||||
#endif
|
||||
.onEnter = NULL,
|
||||
.onExit = NULL,
|
||||
.checkRedirect = NULL,
|
||||
.onDisplayUpdate = NULL,
|
||||
.entries = menuFeaturesEntries,
|
||||
};
|
||||
|
||||
static long cmsx_SaveExitMenu(displayPort_t *pDisplay, const void *ptr)
|
||||
{
|
||||
UNUSED(ptr);
|
||||
|
||||
if (getRebootRequired()) {
|
||||
cmsMenuChange(pDisplay, &cmsx_menuSaveExitReboot);
|
||||
} else {
|
||||
cmsMenuChange(pDisplay, &cmsx_menuSaveExit);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Main
|
||||
|
||||
static const OSD_Entry menuMainEntries[] =
|
||||
{
|
||||
{"-- MAIN --", OME_Label, NULL, NULL, 0},
|
||||
|
||||
{"PROFILE", OME_Submenu, cmsMenuChange, &cmsx_menuImu, 0},
|
||||
{"FEATURES", OME_Submenu, cmsMenuChange, &cmsx_menuFeatures, 0},
|
||||
#ifdef USE_OSD
|
||||
{"OSD", OME_Submenu, cmsMenuChange, &cmsx_menuOsd, 0},
|
||||
#endif
|
||||
{"FC&FIRMWARE", OME_Submenu, cmsMenuChange, &cmsx_menuFirmware, 0},
|
||||
{"MISC", OME_Submenu, cmsMenuChange, &cmsx_menuMisc, 0},
|
||||
{"SAVE/EXIT", OME_Funcall, cmsx_SaveExitMenu, NULL, 0},
|
||||
{NULL,OME_END, NULL, NULL, 0},
|
||||
};
|
||||
|
||||
CMS_Menu cmsx_menuMain = {
|
||||
#ifdef CMS_MENU_DEBUG
|
||||
.GUARD_text = "MENUMAIN",
|
||||
.GUARD_type = OME_MENU,
|
||||
#endif
|
||||
.onEnter = NULL,
|
||||
.onExit = NULL,
|
||||
.checkRedirect = NULL,
|
||||
.onDisplayUpdate = NULL,
|
||||
.entries = menuMainEntries,
|
||||
};
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue