Skip to content

Commit

Permalink
[modules] USE_AIRSPEED_AIR_DATA flag
Browse files Browse the repository at this point in the history
so you can let it calc the airspeed without pushing it to the state interface,
e.g. to use a different airspeed sensor for state interface and hence control
  • Loading branch information
flixr committed Oct 22, 2014
1 parent ddb3584 commit 1dda6d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sw/airborne/modules/air_data/air_data.c
Expand Up @@ -80,6 +80,13 @@ static abi_event temperature_ev;
#endif


#ifndef USE_AIRSPEED_AIR_DATA
#if USE_AIRSPEED
#define USE_AIRSPEED_AIR_DATA TRUE
PRINT_CONFIG_MSG("USE_AIRSPEED_AIR_DATA automatically set to TRUE")
#endif
#endif

/*
* Internal variable to keep track of validity.
*/
Expand Down Expand Up @@ -118,7 +125,9 @@ static void pressure_diff_cb(uint8_t __attribute__((unused)) sender_id, const fl
air_data.differential = *pressure;
if (air_data.calc_airspeed) {
air_data.airspeed = tas_from_dynamic_pressure(air_data.differential);
#if USE_AIRSPEED_AIR_DATA
stateSetAirspeed_f(&air_data.airspeed);
#endif
}
}

Expand Down

0 comments on commit 1dda6d3

Please sign in to comment.