Merge pull request #7510 from etracer65/motor_output_limit_cms
Add CMS entry for motor_output_limit
This commit is contained in:
commit
90e50c9f48
|
@ -1011,7 +1011,7 @@ const clivalue_t valueTable[] = {
|
|||
{ "dterm_cut_lowpass_hz", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 1, 20 }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_cut_lowpass_hz) },
|
||||
#endif
|
||||
|
||||
{ "motor_output_limit", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 1, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, motor_output_limit) },
|
||||
{ "motor_output_limit", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { MOTOR_OUTPUT_LIMIT_PERCENT_MIN, MOTOR_OUTPUT_LIMIT_PERCENT_MAX }, PG_PID_PROFILE, offsetof(pidProfile_t, motor_output_limit) },
|
||||
|
||||
#ifdef USE_LAUNCH_CONTROL
|
||||
{ "launch_control_mode", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_LAUNCH_CONTROL_MODE }, PG_PID_PROFILE, offsetof(pidProfile_t, launchControlMode) },
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
#define DSHOT_TELEMETRY_INPUT_LEN 32
|
||||
#define PROSHOT_TELEMETRY_INPUT_LEN 8
|
||||
|
||||
#define MOTOR_OUTPUT_LIMIT_PERCENT_MIN 1
|
||||
#define MOTOR_OUTPUT_LIMIT_PERCENT_MAX 100
|
||||
|
||||
/*
|
||||
DshotSettingRequest (KISS24). Spin direction, 3d and save Settings reqire 10 requests.. and the TLM Byte must always be high if 1-47 are used to send settings
|
||||
|
||||
|
|
Loading…
Reference in New Issue