mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 04:15:44 +03:00
Merge pull request #9608 from etracer65/fix_mixer_profile_init
Fix initialization of mixer related pidProfile settings
This commit is contained in:
commit
02c92a034c
3 changed files with 15 additions and 3 deletions
|
@ -814,6 +814,7 @@ void changePidProfile(uint8_t pidProfileIndex)
|
|||
|
||||
pidInit(currentPidProfile);
|
||||
initEscEndpoints();
|
||||
mixerInitProfile();
|
||||
}
|
||||
|
||||
beeperConfirmationBeeps(pidProfileIndex + 1);
|
||||
|
|
|
@ -347,6 +347,16 @@ void initEscEndpoints(void)
|
|||
rcCommandThrottleRange = PWM_RANGE_MAX - PWM_RANGE_MIN;
|
||||
}
|
||||
|
||||
// Initialize pidProfile related mixer settings
|
||||
void mixerInitProfile(void)
|
||||
{
|
||||
#ifdef USE_DYN_IDLE
|
||||
idleMinMotorRps = currentPidProfile->idle_min_rpm * 100.0f / 60.0f;
|
||||
idleMaxIncrease = currentPidProfile->idle_max_increase * 0.001f;
|
||||
idleP = currentPidProfile->idle_p * 0.0001f;
|
||||
#endif
|
||||
}
|
||||
|
||||
void mixerInit(mixerMode_e mixerMode)
|
||||
{
|
||||
currentMixerMode = mixerMode;
|
||||
|
@ -357,12 +367,12 @@ void mixerInit(mixerMode_e mixerMode)
|
|||
mixerTricopterInit();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_DYN_IDLE
|
||||
idleMinMotorRps = currentPidProfile->idle_min_rpm * 100.0f / 60.0f;
|
||||
idleMaxIncrease = currentPidProfile->idle_max_increase * 0.001f;
|
||||
idleThrottleOffset = motorConfig()->digitalIdleOffsetValue * 0.0001f;
|
||||
idleP = currentPidProfile->idle_p * 0.0001f;
|
||||
#endif
|
||||
|
||||
mixerInitProfile();
|
||||
}
|
||||
|
||||
#ifdef USE_LAUNCH_CONTROL
|
||||
|
|
|
@ -101,6 +101,7 @@ bool areMotorsRunning(void);
|
|||
void mixerLoadMix(int index, motorMixer_t *customMixers);
|
||||
void initEscEndpoints(void);
|
||||
void mixerInit(mixerMode_e mixerMode);
|
||||
void mixerInitProfile(void);
|
||||
|
||||
void mixerConfigureOutput(void);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue