mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Removed calls to (latching) 'feature()'.
This commit is contained in:
parent
f463dad8bd
commit
c99629bbf1
36 changed files with 432 additions and 145 deletions
|
@ -383,7 +383,7 @@ void initEscEndpoints(void)
|
|||
case PWM_TYPE_DSHOT300:
|
||||
case PWM_TYPE_DSHOT150:
|
||||
disarmMotorOutput = DSHOT_DISARM_COMMAND;
|
||||
if (feature(FEATURE_3D)) {
|
||||
if (featureConfigured(FEATURE_3D)) {
|
||||
motorOutputLow = DSHOT_MIN_THROTTLE + ((DSHOT_3D_DEADBAND_LOW - DSHOT_MIN_THROTTLE) / 100.0f) * CONVERT_PARAMETER_TO_PERCENT(motorConfig()->digitalIdleOffsetValue);
|
||||
} else {
|
||||
motorOutputLow = DSHOT_MIN_THROTTLE + ((DSHOT_MAX_THROTTLE - DSHOT_MIN_THROTTLE) / 100.0f) * CONVERT_PARAMETER_TO_PERCENT(motorConfig()->digitalIdleOffsetValue);
|
||||
|
@ -395,7 +395,7 @@ void initEscEndpoints(void)
|
|||
break;
|
||||
#endif
|
||||
default:
|
||||
if (feature(FEATURE_3D)) {
|
||||
if (featureConfigured(FEATURE_3D)) {
|
||||
disarmMotorOutput = flight3DConfig()->neutral3d;
|
||||
motorOutputLow = flight3DConfig()->limit3d_low;
|
||||
motorOutputHigh = flight3DConfig()->limit3d_high;
|
||||
|
@ -536,7 +536,7 @@ static void calculateThrottleAndCurrentMotorEndpoints(timeUs_t currentTimeUs)
|
|||
static timeUs_t reversalTimeUs = 0; // time when motors last reversed in 3D mode
|
||||
float currentThrottleInputRange = 0;
|
||||
|
||||
if (feature(FEATURE_3D)) {
|
||||
if (featureConfigured(FEATURE_3D)) {
|
||||
if (!ARMING_FLAG(ARMED)) {
|
||||
rcThrottlePrevious = rxConfig()->midrc; // When disarmed set to mid_rc. It always results in positive direction after arming.
|
||||
}
|
||||
|
@ -708,7 +708,7 @@ static void applyMixToMotors(float motorMix[MAX_SUPPORTED_MOTORS])
|
|||
motorOutput = constrain(motorOutput, motorRangeMin, motorRangeMax);
|
||||
}
|
||||
// Motor stop handling
|
||||
if (feature(FEATURE_MOTOR_STOP) && ARMING_FLAG(ARMED) && !feature(FEATURE_3D) && !isAirmodeActive()) {
|
||||
if (featureConfigured(FEATURE_MOTOR_STOP) && ARMING_FLAG(ARMED) && !featureConfigured(FEATURE_3D) && !isAirmodeActive()) {
|
||||
if (((rcData[THROTTLE]) < rxConfig()->mincheck)) {
|
||||
motorOutput = disarmMotorOutput;
|
||||
}
|
||||
|
@ -851,7 +851,7 @@ float convertExternalToMotor(uint16_t externalValue)
|
|||
case true:
|
||||
externalValue = constrain(externalValue, PWM_RANGE_MIN, PWM_RANGE_MAX);
|
||||
|
||||
if (feature(FEATURE_3D)) {
|
||||
if (featureConfigured(FEATURE_3D)) {
|
||||
if (externalValue == PWM_RANGE_MID) {
|
||||
motorValue = DSHOT_DISARM_COMMAND;
|
||||
} else if (externalValue < PWM_RANGE_MID) {
|
||||
|
@ -880,7 +880,7 @@ uint16_t convertMotorToExternal(float motorValue)
|
|||
switch ((int)isMotorProtocolDshot()) {
|
||||
#ifdef USE_DSHOT
|
||||
case true:
|
||||
if (feature(FEATURE_3D)) {
|
||||
if (featureConfigured(FEATURE_3D)) {
|
||||
if (motorValue == DSHOT_DISARM_COMMAND || motorValue < DSHOT_MIN_THROTTLE) {
|
||||
externalValue = PWM_RANGE_MID;
|
||||
} else if (motorValue <= DSHOT_3D_DEADBAND_LOW) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue