mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
add itermrelax to cms
This commit is contained in:
parent
09c98513b8
commit
596222055d
4 changed files with 34 additions and 4 deletions
|
@ -372,10 +372,10 @@ static const char * const lookupTableVideoSystem[] = {
|
|||
#endif // USE_MAX7456
|
||||
|
||||
#if defined(USE_ITERM_RELAX)
|
||||
static const char * const lookupTableItermRelax[] = {
|
||||
const char * const lookupTableItermRelax[] = {
|
||||
"OFF", "RP", "RPY", "RP_INC", "RPY_INC"
|
||||
};
|
||||
static const char * const lookupTableItermRelaxType[] = {
|
||||
const char * const lookupTableItermRelaxType[] = {
|
||||
"GYRO", "SETPOINT"
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -245,3 +245,7 @@ extern const char * const lookupTableRangefinderHardware[];
|
|||
extern const char * const lookupTableLedstripColors[];
|
||||
|
||||
extern const char * const lookupTableRescueAltitudeMode[];
|
||||
|
||||
extern const char * const lookupTableItermRelax[];
|
||||
|
||||
extern const char * const lookupTableItermRelaxType[];
|
|
@ -57,6 +57,7 @@
|
|||
#include "sensors/battery.h"
|
||||
#include "sensors/gyro.h"
|
||||
|
||||
#include "cli/settings.h"
|
||||
|
||||
//
|
||||
// PID
|
||||
|
@ -365,6 +366,12 @@ static uint8_t cmsx_d_min_gain;
|
|||
static uint8_t cmsx_d_min_advance;
|
||||
#endif
|
||||
|
||||
#ifdef USE_ITERM_RELAX
|
||||
static uint8_t cmsx_iterm_relax;
|
||||
static uint8_t cmsx_iterm_relax_type;
|
||||
static uint8_t cmsx_iterm_relax_cutoff;
|
||||
#endif
|
||||
|
||||
static long cmsx_profileOtherOnEnter(void)
|
||||
{
|
||||
setProfileIndexString(pidProfileIndexString, pidProfileIndex, currentPidProfile->profileName);
|
||||
|
@ -392,6 +399,12 @@ static long cmsx_profileOtherOnEnter(void)
|
|||
cmsx_d_min_advance = pidProfile->d_min_advance;
|
||||
#endif
|
||||
|
||||
#ifdef USE_ITERM_RELAX
|
||||
cmsx_iterm_relax = pidProfile->iterm_relax;
|
||||
cmsx_iterm_relax_type = pidProfile->iterm_relax_type;
|
||||
cmsx_iterm_relax_cutoff = pidProfile->iterm_relax_cutoff;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -422,6 +435,12 @@ static long cmsx_profileOtherOnExit(const OSD_Entry *self)
|
|||
pidProfile->d_min_advance = cmsx_d_min_advance;
|
||||
#endif
|
||||
|
||||
#ifdef USE_ITERM_RELAX
|
||||
pidProfile->iterm_relax = cmsx_iterm_relax;
|
||||
pidProfile->iterm_relax_type = cmsx_iterm_relax_type;
|
||||
pidProfile->iterm_relax_cutoff = cmsx_iterm_relax_cutoff;
|
||||
#endif
|
||||
|
||||
initEscEndpoints();
|
||||
return 0;
|
||||
}
|
||||
|
@ -438,6 +457,11 @@ static const OSD_Entry cmsx_menuProfileOtherEntries[] = {
|
|||
#ifdef USE_THROTTLE_BOOST
|
||||
{ "THR BOOST", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_throttleBoost, 0, 100, 1 } , 0 },
|
||||
#endif
|
||||
#ifdef USE_ITERM_RELAX
|
||||
{ "I_RELAX", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_iterm_relax, ITERM_RELAX_COUNT - 1, lookupTableItermRelax }, 0 },
|
||||
{ "I_RELAX TYPE", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_iterm_relax_type, ITERM_RELAX_TYPE_COUNT - 1, lookupTableItermRelaxType }, 0 },
|
||||
{ "I_RELAX CUTOFF", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_iterm_relax_cutoff, 1, 100, 1 }, 0 },
|
||||
#endif
|
||||
#ifdef USE_LAUNCH_CONTROL
|
||||
{"LAUNCH CONTROL", OME_Submenu, cmsMenuChange, &cmsx_menuLaunchControl, 0 },
|
||||
#endif
|
||||
|
|
|
@ -92,12 +92,14 @@ typedef enum {
|
|||
ITERM_RELAX_RP,
|
||||
ITERM_RELAX_RPY,
|
||||
ITERM_RELAX_RP_INC,
|
||||
ITERM_RELAX_RPY_INC
|
||||
ITERM_RELAX_RPY_INC,
|
||||
ITERM_RELAX_COUNT,
|
||||
} itermRelax_e;
|
||||
|
||||
typedef enum {
|
||||
ITERM_RELAX_GYRO,
|
||||
ITERM_RELAX_SETPOINT
|
||||
ITERM_RELAX_SETPOINT,
|
||||
ITERM_RELAX_TYPE_COUNT,
|
||||
} itermRelaxType_e;
|
||||
|
||||
#define MAX_PROFILE_NAME_LENGTH 8u
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue