mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 07:15:18 +03:00
Updates to support parameter groups
This commit is contained in:
parent
13ddcdb9cf
commit
aa561d542b
23 changed files with 338 additions and 322 deletions
|
@ -76,6 +76,7 @@ PG_RESET_TEMPLATE(pidConfig_t, pidConfig,
|
|||
|
||||
PG_REGISTER_ARRAY_WITH_RESET_FN(pidProfile_t, MAX_PROFILE_COUNT, pidProfiles, PG_PID_PROFILE, 0);
|
||||
|
||||
#ifdef USE_PARAMETER_GROUPS
|
||||
void resetPidProfile(pidProfile_t *pidProfile)
|
||||
{
|
||||
RESET_CONFIG(const pidProfile_t, pidProfile,
|
||||
|
@ -128,18 +129,13 @@ void resetPidProfile(pidProfile_t *pidProfile)
|
|||
.itermAcceleratorGain = 1.0f
|
||||
);
|
||||
}
|
||||
|
||||
void pgResetFn_pidProfiles(pidProfile_t *pidProfiles)
|
||||
{
|
||||
for (int i = 0; i < MAX_PROFILE_COUNT; i++) {
|
||||
resetPidProfile(&pidProfiles[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_PARAMETER_GROUPS
|
||||
void resetProfile(profile_t *profile)
|
||||
{
|
||||
resetPidProfile(&profile->pidProfile);
|
||||
}
|
||||
#endif
|
||||
|
||||
void pidSetTargetLooptime(uint32_t pidLooptime)
|
||||
|
@ -260,6 +256,13 @@ void pidInitConfig(const pidProfile_t *pidProfile) {
|
|||
ITermWindupPointInv = 1.0f / (1.0f - ITermWindupPoint);
|
||||
}
|
||||
|
||||
void pidInit(void)
|
||||
{
|
||||
pidSetTargetLooptime(gyro.targetLooptime * pidConfig()->pid_process_denom); // Initialize pid looptime
|
||||
pidInitFilters(currentPidProfile);
|
||||
pidInitConfig(currentPidProfile);
|
||||
}
|
||||
|
||||
static float calcHorizonLevelStrength(void) {
|
||||
float horizonLevelStrength = 0.0f;
|
||||
if (horizonTransition > 0.0f) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue