1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Add CMS entry for motor_output_limit

Will assist tuning while at the field. Added under PROFILE -> MISC PP.
This commit is contained in:
Bruce Luckcuck 2019-02-02 08:57:37 -05:00 committed by Michael Keller
parent e1b84ad204
commit 9d7af42e9f
3 changed files with 13 additions and 4 deletions

View file

@ -39,16 +39,19 @@
#include "common/utils.h"
#include "config/feature.h"
#include "pg/pg.h"
#include "drivers/pwm_output.h"
#include "fc/config.h"
#include "fc/core.h"
#include "fc/controlrate_profile.h"
#include "fc/core.h"
#include "fc/rc_controls.h"
#include "fc/runtime_config.h"
#include "flight/pid.h"
#include "pg/pg.h"
#include "sensors/gyro.h"
@ -322,6 +325,7 @@ static uint8_t cmsx_horizonTransition;
static uint8_t cmsx_throttleBoost;
static uint16_t cmsx_itermAcceleratorGain;
static uint16_t cmsx_itermThrottleThreshold;
static uint8_t cmsx_motorOutputLimit;
static long cmsx_profileOtherOnEnter(void)
{
@ -339,6 +343,7 @@ static long cmsx_profileOtherOnEnter(void)
cmsx_itermThrottleThreshold = pidProfile->itermThrottleThreshold;
cmsx_throttleBoost = pidProfile->throttle_boost;
cmsx_motorOutputLimit = pidProfile->motor_output_limit;
return 0;
}
@ -359,6 +364,7 @@ static long cmsx_profileOtherOnExit(const OSD_Entry *self)
pidProfile->itermThrottleThreshold = cmsx_itermThrottleThreshold;
pidProfile->throttle_boost = cmsx_throttleBoost;
pidProfile->motor_output_limit = cmsx_motorOutputLimit;
return 0;
}
@ -378,7 +384,7 @@ static OSD_Entry cmsx_menuProfileOtherEntries[] = {
#ifdef USE_LAUNCH_CONTROL
{"LAUNCH CONTROL", OME_Submenu, cmsMenuChange, &cmsx_menuLaunchControl, 0 },
#endif
{ "MTR OUT LIM %",OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_motorOutputLimit, MOTOR_OUTPUT_LIMIT_PERCENT_MIN, MOTOR_OUTPUT_LIMIT_PERCENT_MAX, 1}, 0 },
{ "BACK", OME_Back, NULL, NULL, 0 },
{ NULL, OME_END, NULL, NULL, 0 }