From 9830681158df8e56733bcce8278ee33f7b71ccba Mon Sep 17 00:00:00 2001 From: Bruce Luckcuck Date: Fri, 23 Nov 2018 09:25:00 -0500 Subject: [PATCH] Add throttle limit settings to CMS There have been a number of requests for this as it seems to be common for racers to tune these values and adjust the settings as they become more comfortable with a track. Previously the settings could only be adjusted in the CLI and required a computer. Adding them to the CMS makes it easy to adjust in the field. --- src/main/cms/cms_menu_imu.c | 7 +++++++ src/main/fc/controlrate_profile.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/main/cms/cms_menu_imu.c b/src/main/cms/cms_menu_imu.c index 637fce262d..0a61a5527c 100644 --- a/src/main/cms/cms_menu_imu.c +++ b/src/main/cms/cms_menu_imu.c @@ -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 } }; diff --git a/src/main/fc/controlrate_profile.h b/src/main/fc/controlrate_profile.h index 36d2f211f5..bd2f042dd5 100644 --- a/src/main/fc/controlrate_profile.h +++ b/src/main/fc/controlrate_profile.h @@ -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;