1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 23:35:34 +03:00

Merge pull request #11257 from SpencerGraffunder/angle-limit-osd

Add angle limit to OSD settings menu
This commit is contained in:
haslinghuis 2022-06-16 22:47:31 +02:00 committed by GitHub
commit ea5b108193
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -500,6 +500,7 @@ static CMS_Menu cmsx_menuLaunchControl = {
static uint8_t cmsx_angleStrength; static uint8_t cmsx_angleStrength;
static uint8_t cmsx_horizonStrength; static uint8_t cmsx_horizonStrength;
static uint8_t cmsx_horizonTransition; static uint8_t cmsx_horizonTransition;
static uint8_t cmsx_levelAngleLimit;
static uint8_t cmsx_throttleBoost; static uint8_t cmsx_throttleBoost;
static uint8_t cmsx_thrustLinearization; static uint8_t cmsx_thrustLinearization;
static uint16_t cmsx_itermAcceleratorGain; static uint16_t cmsx_itermAcceleratorGain;
@ -541,6 +542,7 @@ static const void *cmsx_profileOtherOnEnter(displayPort_t *pDisp)
cmsx_angleStrength = pidProfile->pid[PID_LEVEL].P; cmsx_angleStrength = pidProfile->pid[PID_LEVEL].P;
cmsx_horizonStrength = pidProfile->pid[PID_LEVEL].I; cmsx_horizonStrength = pidProfile->pid[PID_LEVEL].I;
cmsx_horizonTransition = pidProfile->pid[PID_LEVEL].D; cmsx_horizonTransition = pidProfile->pid[PID_LEVEL].D;
cmsx_levelAngleLimit = pidProfile->levelAngleLimit;
cmsx_itermAcceleratorGain = pidProfile->itermAcceleratorGain; cmsx_itermAcceleratorGain = pidProfile->itermAcceleratorGain;
cmsx_itermThrottleThreshold = pidProfile->itermThrottleThreshold; cmsx_itermThrottleThreshold = pidProfile->itermThrottleThreshold;
@ -590,6 +592,7 @@ static const void *cmsx_profileOtherOnExit(displayPort_t *pDisp, const OSD_Entry
pidProfile->pid[PID_LEVEL].P = cmsx_angleStrength; pidProfile->pid[PID_LEVEL].P = cmsx_angleStrength;
pidProfile->pid[PID_LEVEL].I = cmsx_horizonStrength; pidProfile->pid[PID_LEVEL].I = cmsx_horizonStrength;
pidProfile->pid[PID_LEVEL].D = cmsx_horizonTransition; pidProfile->pid[PID_LEVEL].D = cmsx_horizonTransition;
pidProfile->levelAngleLimit = cmsx_levelAngleLimit;
pidProfile->itermAcceleratorGain = cmsx_itermAcceleratorGain; pidProfile->itermAcceleratorGain = cmsx_itermAcceleratorGain;
pidProfile->itermThrottleThreshold = cmsx_itermThrottleThreshold; pidProfile->itermThrottleThreshold = cmsx_itermThrottleThreshold;
@ -642,6 +645,8 @@ static const OSD_Entry cmsx_menuProfileOtherEntries[] = {
{ "ANGLE STR", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_angleStrength, 0, 200, 1 } }, { "ANGLE STR", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_angleStrength, 0, 200, 1 } },
{ "HORZN STR", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonStrength, 0, 200, 1 } }, { "HORZN STR", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonStrength, 0, 200, 1 } },
{ "HORZN TRS", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonTransition, 0, 200, 1 } }, { "HORZN TRS", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonTransition, 0, 200, 1 } },
{ "ANGLE LIMIT", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_levelAngleLimit, 10, 90, 1 } },
{ "AG GAIN", OME_UINT16, NULL, &(OSD_UINT16_t) { &cmsx_itermAcceleratorGain, ITERM_ACCELERATOR_GAIN_OFF, ITERM_ACCELERATOR_GAIN_MAX, 10 } }, { "AG GAIN", OME_UINT16, NULL, &(OSD_UINT16_t) { &cmsx_itermAcceleratorGain, ITERM_ACCELERATOR_GAIN_OFF, ITERM_ACCELERATOR_GAIN_MAX, 10 } },
{ "AG THR", OME_UINT16, NULL, &(OSD_UINT16_t) { &cmsx_itermThrottleThreshold, 20, 1000, 1 } }, { "AG THR", OME_UINT16, NULL, &(OSD_UINT16_t) { &cmsx_itermThrottleThreshold, 20, 1000, 1 } },
#ifdef USE_THROTTLE_BOOST #ifdef USE_THROTTLE_BOOST