Copter: free allocations in case of allocation failure
[ardupilot.git] / libraries / AP_Airspeed / AP_Airspeed_config.h
blobf12db5cb16c4e925256ff0a57825cb399f9a8287
1 #pragma once
3 #include <AP_Common/AP_Common.h>
4 #include <AP_HAL/AP_HAL_Boards.h>
5 #include <AP_MSP/AP_MSP_config.h>
6 #include <AP_ExternalAHRS/AP_ExternalAHRS_config.h>
8 #ifndef AP_AIRSPEED_ENABLED
9 #define AP_AIRSPEED_ENABLED 1
10 #endif
12 #ifndef AP_AIRSPEED_BACKEND_DEFAULT_ENABLED
13 #define AP_AIRSPEED_BACKEND_DEFAULT_ENABLED AP_AIRSPEED_ENABLED
14 #endif
16 // backends
17 #ifndef AP_AIRSPEED_ANALOG_ENABLED
18 #define AP_AIRSPEED_ANALOG_ENABLED AP_AIRSPEED_BACKEND_DEFAULT_ENABLED
19 #endif
21 #ifndef AP_AIRSPEED_ASP5033_ENABLED
22 #define AP_AIRSPEED_ASP5033_ENABLED AP_AIRSPEED_BACKEND_DEFAULT_ENABLED
23 #endif
25 #ifndef AP_AIRSPEED_DLVR_ENABLED
26 #define AP_AIRSPEED_DLVR_ENABLED AP_AIRSPEED_BACKEND_DEFAULT_ENABLED
27 #endif
29 #ifndef AP_AIRSPEED_DRONECAN_ENABLED
30 #define AP_AIRSPEED_DRONECAN_ENABLED AP_AIRSPEED_BACKEND_DEFAULT_ENABLED && HAL_ENABLE_DRONECAN_DRIVERS
31 #endif
33 #ifndef AP_AIRSPEED_MS4525_ENABLED
34 #define AP_AIRSPEED_MS4525_ENABLED AP_AIRSPEED_BACKEND_DEFAULT_ENABLED
35 #endif
37 #ifndef AP_AIRSPEED_MS5525_ENABLED
38 #define AP_AIRSPEED_MS5525_ENABLED AP_AIRSPEED_BACKEND_DEFAULT_ENABLED
39 #endif
41 #ifndef AP_AIRSPEED_MSP_ENABLED
42 #define AP_AIRSPEED_MSP_ENABLED (AP_AIRSPEED_BACKEND_DEFAULT_ENABLED && HAL_MSP_SENSORS_ENABLED)
43 #endif
45 // note additional vehicle restrictions are made in the .cpp file!
46 #ifndef AP_AIRSPEED_NMEA_ENABLED
47 #define AP_AIRSPEED_NMEA_ENABLED AP_AIRSPEED_BACKEND_DEFAULT_ENABLED
48 #endif
50 #ifndef AP_AIRSPEED_SDP3X_ENABLED
51 #define AP_AIRSPEED_SDP3X_ENABLED AP_AIRSPEED_BACKEND_DEFAULT_ENABLED
52 #endif
54 #ifndef AP_AIRSPEED_SITL_ENABLED
55 #define AP_AIRSPEED_SITL_ENABLED AP_AIRSPEED_BACKEND_DEFAULT_ENABLED && AP_SIM_ENABLED
56 #endif
58 // other AP_Airspeed options:
59 #ifndef AIRSPEED_MAX_SENSORS
60 #define AIRSPEED_MAX_SENSORS 2
61 #endif
63 #ifndef AP_AIRSPEED_AUTOCAL_ENABLE
64 #define AP_AIRSPEED_AUTOCAL_ENABLE AP_AIRSPEED_ENABLED
65 #endif
67 #ifndef AP_AIRSPEED_HYGROMETER_ENABLE
68 #define AP_AIRSPEED_HYGROMETER_ENABLE (AP_AIRSPEED_ENABLED && BOARD_FLASH_SIZE > 1024)
69 #endif
71 #ifndef AP_AIRSPEED_EXTERNAL_ENABLED
72 #define AP_AIRSPEED_EXTERNAL_ENABLED AP_AIRSPEED_ENABLED && HAL_EXTERNAL_AHRS_ENABLED
73 #endif