Update oXs_out_frsky.cpp
[openXsensor.git] / openXsensor / oXs_config_macros.h
blob5797dac9f57fd47fda9f7a007b0c037e398fd4a0
1 #ifndef OXS_CONFIG_MACROS_h
2 #define OXS_CONFIG_MACROS_h
4 // --------- xx - Reserved for developer. DEBUG must be activated here when we want to debug one or several functions in some other files. ---------
5 //#define DEBUG
6 ///#define DEBUG_BLINK // use by developper in order to blink the led without using uart for debugging
9 #define BASED_ON_AIRSPEED 0
10 #define BASED_ON_GPS_SPEED 1
11 #define AVERAGING_DELAY_MILLISEC AVERAGING_TOLERANCE * 100
13 #define FIRST_BARO 1
14 #define SECOND_BARO 2
15 #define AVERAGE_FIRST_SECOND 4
16 #define AIRSPEED_COMPENSATED 3
17 #define BARO_AND_IMU 5
18 #define PPM_SELECTION 6
20 #include <Arduino.h>
21 struct ONE_MEASUREMENT {
22 uint8_t available ;
23 int32_t value ;
24 } ;
26 #define FRSKY_SPORT 1
27 #define FRSKY_HUB 2
28 #define FRSKY_SPORT_HUB 3
29 #define MULTIPLEX 4
30 #define HOTT 5
31 #define JETI 6
33 #define NO_BARO 1
34 #define MS5611 2
35 #define GY86 3
36 #define BMP085 4
37 #define BMP180 5
38 #define BMP280 6
39 #define GY87 7
41 #define NO_AIRSPEED 1
42 #define MS4525 2
43 #define MVPX7002 3
44 #define SDP3X 4
46 #define NO 1
47 #define YES 2
49 #define NTC 20
51 #define SECONDS_SINCE_T0 32
52 #define AVERAGE_VSPEED_SINCE_TO 33
54 /***************************************************************************************/
55 /* oXs code used by Flow sensor and for SPORT Lua scripts */
56 /***************************************************************************************/
57 #define TX_FIELD_FLOW_1 0
58 #define TX_FIELD_FLOW_2 1
59 #define TX_FIELD_FLOW_3 2
60 #define TX_FIELD_FLOW_4 3
61 #define TX_FIELD_FLOW_CORR_1 4
62 #define TX_FIELD_FLOW_CORR_2 5
63 #define TX_FIELD_FLOW_CORR_3 6
64 #define TX_FIELD_FLOW_CORR_4 7
65 #define TX_FIELD_TANK_CAPACITY 8
66 #define TX_FIELD_RESET_FUEL 9
67 #define TX_FIELD_PPM 0x10
70 #ifdef DEBUG
71 //#include "HardwareSerial.h"
72 #endif
74 #ifdef GPS_INSTALLED
75 //#include "HardwareSerial.h"
76 #endif
80 #ifdef FIRST_BARO_SENSOR_USE
81 #if (FIRST_BARO_SENSOR_USE == MS5611 ) || (FIRST_BARO_SENSOR_USE == GY86 ) || (FIRST_BARO_SENSOR_USE == BMP085 ) || (FIRST_BARO_SENSOR_USE == BMP180 ) || (FIRST_BARO_SENSOR_USE == BMP280 ) || (FIRST_BARO_SENSOR_USE == GY87 )
82 #define VARIO
83 #endif
84 #if (FIRST_BARO_SENSOR_USE == BMP085 ) || (FIRST_BARO_SENSOR_USE == BMP180 ) || (FIRST_BARO_SENSOR_USE == GY87 )
85 #define SENSOR_IS_BMP180
86 #endif
87 #if (FIRST_BARO_SENSOR_USE == BMP280 )
88 #define SENSOR_IS_BMP280
89 #endif
90 #endif
92 #ifdef SECOND_BARO_SENSOR_USE
93 #if SECOND_BARO_SENSOR_USE == MS5611
94 #define VARIO2
95 #endif
96 #endif
98 #if ( defined( FIRST_BARO_SENSOR_USE ) && ( (FIRST_BARO_SENSOR_USE == MS5611 ) || (FIRST_BARO_SENSOR_USE == GY86 ) )) || ( defined( SECOND_BARO_SENSOR_USE ) && ( (SECOND_BARO_SENSOR_USE == MS5611 ) || (SECOND_BARO_SENSOR_USE == GY86 ) ))
99 #define SENSOR_IS_MS5611
100 #endif
102 #if defined ( PIN_PPM ) || ( defined(PPM_VIA_SPORT) && ( (PROTOCOL == FRSKY_SPORT) || (PROTOCOL == FRSKY_SPORT_HUB) ) )
103 #define PPM_IS_USED
104 #endif
106 #ifdef AIRSPEED_SENSOR_USE
107 #if ( AIRSPEED_SENSOR_USE == MS4525 )
108 #define AIRSPEED
109 #define AIRSPEED_IS_USED
110 #define AIRSPEED_4525
111 #elif ( AIRSPEED_SENSOR_USE == MPXV7002 )
112 #define AIRSPEED_IS_USED
113 #define AIRSPEED_7002
114 #elif ( AIRSPEED_SENSOR_USE == SDP3X )
115 #define AIRSPEED_IS_USED
116 #define AIRSPEED_SDP3X
117 #endif
118 #endif
121 #ifdef CALCULATE_RPM
122 #if ( CALCULATE_RPM == YES )
123 #define MEASURE_RPM
124 #endif
125 #endif
128 #ifdef A_GPS_IS_CONNECTED
129 #if ( A_GPS_IS_CONNECTED == YES )
130 #define GPS_INSTALLED
131 #endif
132 #endif
135 #ifdef A_MPU6050_IS_CONNECTED
136 #if ( A_MPU6050_IS_CONNECTED == YES )
137 #define USE_6050
138 #endif
139 #endif
141 #ifdef A_MPU6050_IS_CONNECTED
142 #if ( A_MPU6050_IS_CONNECTED == YES )
143 #ifdef CALCULATE_YAW_WITH_HMC5883
144 #if ( CALCULATE_YAW_WITH_HMC5883 == YES )
145 #define USE_HMC5883
146 #endif
147 #endif
148 #endif
149 #endif
151 #if defined( DISPLAY_ACC_OFFSET ) && defined ( A_MPU6050_IS_CONNECTED ) && ( A_MPU6050_IS_CONNECTED == YES )
152 #define DEBUG
153 #endif
154 #if defined( GENERATE_MAG_CALIBRATION_DATA ) && defined ( A_MPU6050_IS_CONNECTED ) && ( A_MPU6050_IS_CONNECTED == YES ) && defined ( USE_HMC5883 )
155 #define DEBUG
156 #endif
159 #endif