Merge pull request #7117 from etracer65/add_throttle_limit_to_cms

Add throttle limit settings to CMS
This commit is contained in:
Michael Keller 2018-11-25 12:57:08 +13:00 committed by GitHub
commit 68eadcf6f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -66,6 +66,10 @@ static uint8_t rateProfileIndex;
static char rateProfileIndexString[] = " p-r";
static controlRateConfig_t rateProfile;
static const char * const osdTableThrottleLimitType[] = {
"OFF", "SCALE", "CLIP"
};
static long cmsx_menuImu_onEnter(void)
{
pidProfileIndex = getCurrentPidProfileIndex();
@ -230,6 +234,9 @@ static OSD_Entry cmsx_menuRateProfileEntries[] =
{ "THRPID ATT", OME_FLOAT, NULL, &(OSD_FLOAT_t) { &rateProfile.dynThrPID, 0, 100, 1, 10}, 0 },
{ "TPA BRKPT", OME_UINT16, NULL, &(OSD_UINT16_t){ &rateProfile.tpa_breakpoint, 1000, 2000, 10}, 0 },
{ "THR LIM TYPE",OME_TAB, NULL, &(OSD_TAB_t) { &rateProfile.throttle_limit_type, THROTTLE_LIMIT_TYPE_COUNT - 1, osdTableThrottleLimitType}, 0 },
{ "THR LIM %", OME_UINT8, NULL, &(OSD_UINT8_t) { &rateProfile.throttle_limit_percent, 25, 100, 1}, 0 },
{ "BACK", OME_Back, NULL, NULL, 0 },
{ NULL, OME_END, NULL, NULL, 0 }
};

View File

@ -35,6 +35,7 @@ typedef enum {
THROTTLE_LIMIT_TYPE_OFF = 0,
THROTTLE_LIMIT_TYPE_SCALE,
THROTTLE_LIMIT_TYPE_CLIP,
THROTTLE_LIMIT_TYPE_COUNT // must be the last entry
} throttleLimitType_e;