mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
Fix initialization of mixer related pidProfile settings
Previously the variables were only initialized at boot and were not updated when the pidProfile changed.
This commit is contained in:
parent
9b6911f80c
commit
37069ba267
3 changed files with 15 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue