1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Fix "may be used uninitialized" warnings

Prevent the false warnings when compiled for debugging
This commit is contained in:
Bruce Luckcuck 2020-02-21 18:48:30 -05:00
parent fcef76b82f
commit c128b16122
2 changed files with 6 additions and 5 deletions

View file

@ -321,7 +321,7 @@ FAST_CODE void scheduler(void)
uint16_t selectedTaskDynamicPriority = 0; uint16_t selectedTaskDynamicPriority = 0;
uint16_t waitingTasks = 0; uint16_t waitingTasks = 0;
bool realtimeTaskRan = false; bool realtimeTaskRan = false;
timeDelta_t gyroTaskDelayUs; timeDelta_t gyroTaskDelayUs = 0;
if (gyroEnabled) { if (gyroEnabled) {
// Realtime gyro/filtering/PID tasks get complete priority // Realtime gyro/filtering/PID tasks get complete priority

View file

@ -1320,10 +1320,6 @@ void initYawSpinRecovery(int maxYawRate)
int threshold; int threshold;
switch (gyroConfig()->yaw_spin_recovery) { switch (gyroConfig()->yaw_spin_recovery) {
case YAW_SPIN_RECOVERY_OFF:
enabledFlag = false;
threshold = YAW_SPIN_RECOVERY_THRESHOLD_MAX;
break;
case YAW_SPIN_RECOVERY_ON: case YAW_SPIN_RECOVERY_ON:
enabledFlag = true; enabledFlag = true;
threshold = gyroConfig()->yaw_spin_threshold; threshold = gyroConfig()->yaw_spin_threshold;
@ -1333,6 +1329,11 @@ void initYawSpinRecovery(int maxYawRate)
const int overshootAllowance = MAX(maxYawRate / 4, 200); // Allow a 25% or minimum 200dps overshoot tolerance const int overshootAllowance = MAX(maxYawRate / 4, 200); // Allow a 25% or minimum 200dps overshoot tolerance
threshold = constrain(maxYawRate + overshootAllowance, YAW_SPIN_RECOVERY_THRESHOLD_MIN, YAW_SPIN_RECOVERY_THRESHOLD_MAX); threshold = constrain(maxYawRate + overshootAllowance, YAW_SPIN_RECOVERY_THRESHOLD_MIN, YAW_SPIN_RECOVERY_THRESHOLD_MAX);
break; break;
case YAW_SPIN_RECOVERY_OFF:
default:
enabledFlag = false;
threshold = YAW_SPIN_RECOVERY_THRESHOLD_MAX;
break;
} }
yawSpinRecoveryEnabled = enabledFlag; yawSpinRecoveryEnabled = enabledFlag;