mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Simplify #ifdef nesting
This commit is contained in:
parent
8f6de3e553
commit
6999cf1742
1 changed files with 6 additions and 8 deletions
|
@ -460,16 +460,14 @@ void executePeriodicTasks(void)
|
|||
|
||||
#if defined(BARO) || defined(SONAR)
|
||||
case CALCULATE_ALTITUDE_TASK:
|
||||
|
||||
#if defined(BARO) && !defined(SONAR)
|
||||
if (sensors(SENSOR_BARO) && isBaroReady()) {
|
||||
if (false
|
||||
#if defined(BARO)
|
||||
|| (sensors(SENSOR_BARO) && isBaroReady())
|
||||
#endif
|
||||
#if defined(BARO) && defined(SONAR)
|
||||
if ((sensors(SENSOR_BARO) && isBaroReady()) || sensors(SENSOR_SONAR)) {
|
||||
#endif
|
||||
#if !defined(BARO) && defined(SONAR)
|
||||
if (sensors(SENSOR_SONAR)) {
|
||||
#if defined(SONAR)
|
||||
|| sensors(SENSOR_SONAR)
|
||||
#endif
|
||||
) {
|
||||
calculateEstimatedAltitude(currentTime);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue