Merge pull request #2560 from lostcontrol/cms_digital_idle_percent
Add digital_idle_percent to CMS
This commit is contained in:
commit
00040a7bdc
|
@ -90,12 +90,14 @@ CMS_Menu cmsx_menuRcPreview = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static uint16_t motorConfig_minthrottle;
|
static uint16_t motorConfig_minthrottle;
|
||||||
|
static uint8_t motorConfig_digitalIdleOffsetPercent;
|
||||||
static uint8_t batteryConfig_vbatscale;
|
static uint8_t batteryConfig_vbatscale;
|
||||||
static uint8_t batteryConfig_vbatmaxcellvoltage;
|
static uint8_t batteryConfig_vbatmaxcellvoltage;
|
||||||
|
|
||||||
static long cmsx_menuMiscOnEnter(void)
|
static long cmsx_menuMiscOnEnter(void)
|
||||||
{
|
{
|
||||||
motorConfig_minthrottle = motorConfig()->minthrottle;
|
motorConfig_minthrottle = motorConfig()->minthrottle;
|
||||||
|
motorConfig_digitalIdleOffsetPercent = 10 * motorConfig()->digitalIdleOffsetPercent;
|
||||||
batteryConfig_vbatscale = batteryConfig()->vbatscale;
|
batteryConfig_vbatscale = batteryConfig()->vbatscale;
|
||||||
batteryConfig_vbatmaxcellvoltage = batteryConfig()->vbatmaxcellvoltage;
|
batteryConfig_vbatmaxcellvoltage = batteryConfig()->vbatmaxcellvoltage;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -106,6 +108,7 @@ static long cmsx_menuMiscOnExit(const OSD_Entry *self)
|
||||||
UNUSED(self);
|
UNUSED(self);
|
||||||
|
|
||||||
motorConfigMutable()->minthrottle = motorConfig_minthrottle;
|
motorConfigMutable()->minthrottle = motorConfig_minthrottle;
|
||||||
|
motorConfigMutable()->digitalIdleOffsetPercent = motorConfig_digitalIdleOffsetPercent / 10.0f;
|
||||||
batteryConfigMutable()->vbatscale = batteryConfig_vbatscale;
|
batteryConfigMutable()->vbatscale = batteryConfig_vbatscale;
|
||||||
batteryConfigMutable()->vbatmaxcellvoltage = batteryConfig_vbatmaxcellvoltage;
|
batteryConfigMutable()->vbatmaxcellvoltage = batteryConfig_vbatmaxcellvoltage;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -115,10 +118,11 @@ static OSD_Entry menuMiscEntries[]=
|
||||||
{
|
{
|
||||||
{ "-- MISC --", OME_Label, NULL, NULL, 0 },
|
{ "-- MISC --", OME_Label, NULL, NULL, 0 },
|
||||||
|
|
||||||
{ "MIN THR", OME_UINT16, NULL, &(OSD_UINT16_t){ &motorConfig_minthrottle, 1000, 2000, 1 }, 0 },
|
{ "MIN THR", OME_UINT16, NULL, &(OSD_UINT16_t){ &motorConfig_minthrottle, 1000, 2000, 1 }, 0 },
|
||||||
{ "VBAT SCALE", OME_UINT8, NULL, &(OSD_UINT8_t) { &batteryConfig_vbatscale, 1, 250, 1 }, 0 },
|
{ "DIGITAL IDLE", OME_FLOAT, NULL, &(OSD_FLOAT_t) { &motorConfig_digitalIdleOffsetPercent, 0, 200, 1, 100 }, 0 },
|
||||||
{ "VBAT CLMAX", OME_UINT8, NULL, &(OSD_UINT8_t) { &batteryConfig_vbatmaxcellvoltage, 10, 50, 1 }, 0 },
|
{ "VBAT SCALE", OME_UINT8, NULL, &(OSD_UINT8_t) { &batteryConfig_vbatscale, 1, 250, 1 }, 0 },
|
||||||
{ "RC PREV", OME_Submenu, cmsMenuChange, &cmsx_menuRcPreview, 0},
|
{ "VBAT CLMAX", OME_UINT8, NULL, &(OSD_UINT8_t) { &batteryConfig_vbatmaxcellvoltage, 10, 50, 1 }, 0 },
|
||||||
|
{ "RC PREV", OME_Submenu, cmsMenuChange, &cmsx_menuRcPreview, 0},
|
||||||
|
|
||||||
{ "BACK", OME_Back, NULL, NULL, 0},
|
{ "BACK", OME_Back, NULL, NULL, 0},
|
||||||
{ NULL, OME_END, NULL, NULL, 0}
|
{ NULL, OME_END, NULL, NULL, 0}
|
||||||
|
|
Loading…
Reference in New Issue