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

Merge pull request #4252 from McGiverGim/bf-add_antigravity_cms

Add antigravity config to the CMS
This commit is contained in:
Martin Budden 2017-10-09 13:04:55 +01:00 committed by GitHub
commit 74c8fefd63

View file

@ -235,6 +235,8 @@ static uint8_t cmsx_setpointRelaxRatio;
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 uint16_t cmsx_itermAcceleratorGain;
static uint16_t cmsx_itermThrottleThreshold;
static long cmsx_profileOtherOnEnter(void) static long cmsx_profileOtherOnEnter(void)
{ {
@ -248,6 +250,9 @@ static long cmsx_profileOtherOnEnter(void)
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_itermAcceleratorGain = pidProfile->itermAcceleratorGain;
cmsx_itermThrottleThreshold = pidProfile->itermThrottleThreshold;
return 0; return 0;
} }
@ -264,6 +269,9 @@ static long cmsx_profileOtherOnExit(const OSD_Entry *self)
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->itermAcceleratorGain = cmsx_itermAcceleratorGain;
pidProfile->itermThrottleThreshold = cmsx_itermThrottleThreshold;
return 0; return 0;
} }
@ -275,6 +283,8 @@ static OSD_Entry cmsx_menuProfileOtherEntries[] = {
{ "ANGLE STR", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_angleStrength, 0, 200, 1 } , 0 }, { "ANGLE STR", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_angleStrength, 0, 200, 1 } , 0 },
{ "HORZN STR", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonStrength, 0, 200, 1 } , 0 }, { "HORZN STR", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonStrength, 0, 200, 1 } , 0 },
{ "HORZN TRS", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonTransition, 0, 200, 1 } , 0 }, { "HORZN TRS", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonTransition, 0, 200, 1 } , 0 },
{ "AG GAIN", OME_UINT16, NULL, &(OSD_UINT16_t) { &cmsx_itermAcceleratorGain, 1000, 30000, 1 } , 0 },
{ "AG THR", OME_UINT16, NULL, &(OSD_UINT16_t) { &cmsx_itermThrottleThreshold, 20, 1000, 1 } , 0 },
{ "BACK", OME_Back, NULL, NULL, 0 }, { "BACK", OME_Back, NULL, NULL, 0 },
{ NULL, OME_END, NULL, NULL, 0 } { NULL, OME_END, NULL, NULL, 0 }