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

Simplify #ifdef nesting

This commit is contained in:
Petr Ledvina 2015-10-09 13:19:55 +02:00 committed by Dominic Clifton
parent 8f6de3e553
commit 6999cf1742

View file

@ -460,16 +460,14 @@ void executePeriodicTasks(void)
#if defined(BARO) || defined(SONAR) #if defined(BARO) || defined(SONAR)
case CALCULATE_ALTITUDE_TASK: case CALCULATE_ALTITUDE_TASK:
if (false
#if defined(BARO) && !defined(SONAR) #if defined(BARO)
if (sensors(SENSOR_BARO) && isBaroReady()) { || (sensors(SENSOR_BARO) && isBaroReady())
#endif #endif
#if defined(BARO) && defined(SONAR) #if defined(SONAR)
if ((sensors(SENSOR_BARO) && isBaroReady()) || sensors(SENSOR_SONAR)) { || sensors(SENSOR_SONAR)
#endif
#if !defined(BARO) && defined(SONAR)
if (sensors(SENSOR_SONAR)) {
#endif #endif
) {
calculateEstimatedAltitude(currentTime); calculateEstimatedAltitude(currentTime);
} }
break; break;