Move Debug Mode
This commit is contained in:
parent
6433aaa688
commit
1dc8cca8ae
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#if defined(USE_CMS) && defined(USE_BLACKBOX)
|
#if defined(USE_CMS) && defined(USE_BLACKBOX)
|
||||||
|
|
||||||
|
#include "build/debug.h"
|
||||||
#include "build/version.h"
|
#include "build/version.h"
|
||||||
|
|
||||||
#include "blackbox/blackbox.h"
|
#include "blackbox/blackbox.h"
|
||||||
|
@ -68,6 +69,7 @@ static uint16_t blackboxConfig_p_ratio;
|
||||||
|
|
||||||
static uint8_t cmsx_BlackboxDevice;
|
static uint8_t cmsx_BlackboxDevice;
|
||||||
static OSD_TAB_t cmsx_BlackboxDeviceTable = { &cmsx_BlackboxDevice, 2, cmsx_BlackboxDeviceNames };
|
static OSD_TAB_t cmsx_BlackboxDeviceTable = { &cmsx_BlackboxDevice, 2, cmsx_BlackboxDeviceNames };
|
||||||
|
static debugType_e systemConfig_debug_mode;
|
||||||
|
|
||||||
#define CMS_BLACKBOX_STRING_LENGTH 8
|
#define CMS_BLACKBOX_STRING_LENGTH 8
|
||||||
static char cmsx_BlackboxStatus[CMS_BLACKBOX_STRING_LENGTH];
|
static char cmsx_BlackboxStatus[CMS_BLACKBOX_STRING_LENGTH];
|
||||||
|
@ -182,6 +184,7 @@ static const void *cmsx_Blackbox_onEnter(void)
|
||||||
cmsx_BlackboxDevice = blackboxConfig()->device;
|
cmsx_BlackboxDevice = blackboxConfig()->device;
|
||||||
|
|
||||||
blackboxConfig_p_ratio = blackboxConfig()->p_ratio;
|
blackboxConfig_p_ratio = blackboxConfig()->p_ratio;
|
||||||
|
systemConfig_debug_mode = systemConfig()->debug_mode;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,6 +197,7 @@ static const void *cmsx_Blackbox_onExit(const OSD_Entry *self)
|
||||||
blackboxValidateConfig();
|
blackboxValidateConfig();
|
||||||
}
|
}
|
||||||
blackboxConfigMutable()->p_ratio = blackboxConfig_p_ratio;
|
blackboxConfigMutable()->p_ratio = blackboxConfig_p_ratio;
|
||||||
|
systemConfigMutable()->debug_mode = systemConfig_debug_mode;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -206,6 +210,7 @@ static const OSD_Entry cmsx_menuBlackboxEntries[] =
|
||||||
{ "(USED)", OME_String, NULL, &cmsx_BlackboxDeviceStorageUsed, 0 },
|
{ "(USED)", OME_String, NULL, &cmsx_BlackboxDeviceStorageUsed, 0 },
|
||||||
{ "(FREE)", OME_String, NULL, &cmsx_BlackboxDeviceStorageFree, 0 },
|
{ "(FREE)", OME_String, NULL, &cmsx_BlackboxDeviceStorageFree, 0 },
|
||||||
{ "P RATIO", OME_UINT16, NULL, &(OSD_UINT16_t){ &blackboxConfig_p_ratio, 1, INT16_MAX, 1 }, REBOOT_REQUIRED },
|
{ "P RATIO", OME_UINT16, NULL, &(OSD_UINT16_t){ &blackboxConfig_p_ratio, 1, INT16_MAX, 1 }, REBOOT_REQUIRED },
|
||||||
|
{ "DEBUG MODE", OME_TAB, NULL, &(OSD_TAB_t) { &systemConfig_debug_mode, DEBUG_COUNT - 1, debugModeNames }, 0 },
|
||||||
|
|
||||||
#ifdef USE_FLASHFS
|
#ifdef USE_FLASHFS
|
||||||
{ "ERASE FLASH", OME_Funcall, cmsx_EraseFlash, NULL, 0 },
|
{ "ERASE FLASH", OME_Funcall, cmsx_EraseFlash, NULL, 0 },
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
#ifdef USE_CMS
|
#ifdef USE_CMS
|
||||||
|
|
||||||
#include "build/debug.h"
|
|
||||||
#include "build/version.h"
|
#include "build/version.h"
|
||||||
|
|
||||||
#include "cms/cms.h"
|
#include "cms/cms.h"
|
||||||
|
@ -111,14 +110,12 @@ CMS_Menu cmsx_menuRcPreview = {
|
||||||
static uint16_t motorConfig_minthrottle;
|
static uint16_t motorConfig_minthrottle;
|
||||||
static uint8_t motorConfig_digitalIdleOffsetValue;
|
static uint8_t motorConfig_digitalIdleOffsetValue;
|
||||||
static uint8_t rxConfig_fpvCamAngleDegrees;
|
static uint8_t rxConfig_fpvCamAngleDegrees;
|
||||||
static debugType_e systemConfig_debug_mode;
|
|
||||||
|
|
||||||
static const void *cmsx_menuMiscOnEnter(void)
|
static const void *cmsx_menuMiscOnEnter(void)
|
||||||
{
|
{
|
||||||
motorConfig_minthrottle = motorConfig()->minthrottle;
|
motorConfig_minthrottle = motorConfig()->minthrottle;
|
||||||
motorConfig_digitalIdleOffsetValue = motorConfig()->digitalIdleOffsetValue / 10;
|
motorConfig_digitalIdleOffsetValue = motorConfig()->digitalIdleOffsetValue / 10;
|
||||||
rxConfig_fpvCamAngleDegrees = rxConfig()->fpvCamAngleDegrees;
|
rxConfig_fpvCamAngleDegrees = rxConfig()->fpvCamAngleDegrees;
|
||||||
systemConfig_debug_mode = systemConfig()->debug_mode;
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +127,6 @@ static const void *cmsx_menuMiscOnExit(const OSD_Entry *self)
|
||||||
motorConfigMutable()->minthrottle = motorConfig_minthrottle;
|
motorConfigMutable()->minthrottle = motorConfig_minthrottle;
|
||||||
motorConfigMutable()->digitalIdleOffsetValue = 10 * motorConfig_digitalIdleOffsetValue;
|
motorConfigMutable()->digitalIdleOffsetValue = 10 * motorConfig_digitalIdleOffsetValue;
|
||||||
rxConfigMutable()->fpvCamAngleDegrees = rxConfig_fpvCamAngleDegrees;
|
rxConfigMutable()->fpvCamAngleDegrees = rxConfig_fpvCamAngleDegrees;
|
||||||
systemConfigMutable()->debug_mode = systemConfig_debug_mode;
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -141,7 +137,6 @@ static const OSD_Entry menuMiscEntries[]=
|
||||||
|
|
||||||
{ "MIN THR", OME_UINT16, NULL, &(OSD_UINT16_t){ &motorConfig_minthrottle, 1000, 2000, 1 }, REBOOT_REQUIRED },
|
{ "MIN THR", OME_UINT16, NULL, &(OSD_UINT16_t){ &motorConfig_minthrottle, 1000, 2000, 1 }, REBOOT_REQUIRED },
|
||||||
{ "DIGITAL IDLE", OME_UINT8, NULL, &(OSD_UINT8_t) { &motorConfig_digitalIdleOffsetValue, 0, 200, 1 }, REBOOT_REQUIRED },
|
{ "DIGITAL IDLE", OME_UINT8, NULL, &(OSD_UINT8_t) { &motorConfig_digitalIdleOffsetValue, 0, 200, 1 }, REBOOT_REQUIRED },
|
||||||
{ "DEBUG MODE", OME_TAB, NULL, &(OSD_TAB_t) { &systemConfig_debug_mode, DEBUG_COUNT - 1, debugModeNames }, 0 },
|
|
||||||
{ "FPV CAM ANGLE", OME_UINT8, NULL, &(OSD_UINT8_t) { &rxConfig_fpvCamAngleDegrees, 0, 90, 1 }, 0 },
|
{ "FPV CAM ANGLE", OME_UINT8, NULL, &(OSD_UINT8_t) { &rxConfig_fpvCamAngleDegrees, 0, 90, 1 }, 0 },
|
||||||
{ "RC PREV", OME_Submenu, cmsMenuChange, &cmsx_menuRcPreview, 0},
|
{ "RC PREV", OME_Submenu, cmsMenuChange, &cmsx_menuRcPreview, 0},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue