mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Make dyn_idle a conditional compile
This commit is contained in:
parent
b4c4757470
commit
e39d5e7000
3 changed files with 7 additions and 2 deletions
|
@ -1056,13 +1056,14 @@ const clivalue_t valueTable[] = {
|
||||||
{ "transient_throttle_limit", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, 30 }, PG_PID_PROFILE, offsetof(pidProfile_t, transient_throttle_limit) },
|
{ "transient_throttle_limit", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, 30 }, PG_PID_PROFILE, offsetof(pidProfile_t, transient_throttle_limit) },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_DYN_IDLE
|
||||||
{ "idle_hz", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_hz) },
|
{ "idle_hz", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_hz) },
|
||||||
{ "idle_adjustment_speed", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 25, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_adjustment_speed) },
|
{ "idle_adjustment_speed", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 25, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_adjustment_speed) },
|
||||||
{ "idle_throttle", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_throttle) },
|
{ "idle_throttle", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_throttle) },
|
||||||
{ "idle_p", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 10, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_p) },
|
{ "idle_p", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 10, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_p) },
|
||||||
{ "idle_pid_limit", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 10, 255 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_pid_limit) },
|
{ "idle_pid_limit", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 10, 255 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_pid_limit) },
|
||||||
{ "idle_max_increase", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 255 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_max_increase) },
|
{ "idle_max_increase", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 255 }, PG_PID_PROFILE, offsetof(pidProfile_t, idle_max_increase) },
|
||||||
|
#endif
|
||||||
|
|
||||||
// PG_TELEMETRY_CONFIG
|
// PG_TELEMETRY_CONFIG
|
||||||
#ifdef USE_TELEMETRY
|
#ifdef USE_TELEMETRY
|
||||||
|
|
|
@ -575,7 +575,7 @@ static void calculateThrottleAndCurrentMotorEndpoints(timeUs_t currentTimeUs)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
static float motorRangeMinIncrease = 0;
|
static float motorRangeMinIncrease = 0;
|
||||||
#ifdef USE_RPM_FILTER
|
#ifdef USE_DYN_IDLE
|
||||||
if (currentPidProfile->idle_hz) {
|
if (currentPidProfile->idle_hz) {
|
||||||
static float oldMinRpm;
|
static float oldMinRpm;
|
||||||
const float maxIncrease = isAirmodeActivated() ? currentPidProfile->idle_max_increase * 0.001f : 0.04f;
|
const float maxIncrease = isAirmodeActivated() ? currentPidProfile->idle_max_increase * 0.001f : 0.04f;
|
||||||
|
@ -848,7 +848,9 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
|
||||||
throttle = pidCompensateThrustLinearization(throttle);
|
throttle = pidCompensateThrustLinearization(throttle);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_DYN_IDLE
|
||||||
throttle += currentPidProfile->idle_throttle * 0.001f;
|
throttle += currentPidProfile->idle_throttle * 0.001f;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(USE_THROTTLE_BOOST)
|
#if defined(USE_THROTTLE_BOOST)
|
||||||
if (throttleBoost > 0.0f) {
|
if (throttleBoost > 0.0f) {
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
#define USE_DSHOT_TELEMETRY
|
#define USE_DSHOT_TELEMETRY
|
||||||
#define USE_DSHOT_TELEMETRY_STATS
|
#define USE_DSHOT_TELEMETRY_STATS
|
||||||
#define USE_RPM_FILTER
|
#define USE_RPM_FILTER
|
||||||
|
#define USE_DYN_IDLE
|
||||||
#define I2C3_OVERCLOCK true
|
#define I2C3_OVERCLOCK true
|
||||||
#define USE_GYRO_DATA_ANALYSE
|
#define USE_GYRO_DATA_ANALYSE
|
||||||
#define USE_ADC
|
#define USE_ADC
|
||||||
|
@ -83,6 +84,7 @@
|
||||||
#define USE_DSHOT_TELEMETRY
|
#define USE_DSHOT_TELEMETRY
|
||||||
#define USE_DSHOT_TELEMETRY_STATS
|
#define USE_DSHOT_TELEMETRY_STATS
|
||||||
#define USE_RPM_FILTER
|
#define USE_RPM_FILTER
|
||||||
|
#define USE_DYN_IDLE
|
||||||
#define I2C3_OVERCLOCK true
|
#define I2C3_OVERCLOCK true
|
||||||
#define I2C4_OVERCLOCK true
|
#define I2C4_OVERCLOCK true
|
||||||
#define USE_GYRO_DATA_ANALYSE
|
#define USE_GYRO_DATA_ANALYSE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue