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. ---------
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
15 #define AVERAGE_FIRST_SECOND 4
16 #define AIRSPEED_COMPENSATED 3
17 #define BARO_AND_IMU 5
18 #define PPM_SELECTION 6
21 struct ONE_MEASUREMENT
{
28 #define FRSKY_SPORT_HUB 3
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
71 //#include "HardwareSerial.h"
75 //#include "HardwareSerial.h"
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 )
84 #if (FIRST_BARO_SENSOR_USE == BMP085 ) || (FIRST_BARO_SENSOR_USE == BMP180 ) || (FIRST_BARO_SENSOR_USE == GY87 )
85 #define SENSOR_IS_BMP180
87 #if (FIRST_BARO_SENSOR_USE == BMP280 )
88 #define SENSOR_IS_BMP280
92 #ifdef SECOND_BARO_SENSOR_USE
93 #if SECOND_BARO_SENSOR_USE == MS5611
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
102 #if defined ( PIN_PPM ) || ( defined(PPM_VIA_SPORT) && ( (PROTOCOL == FRSKY_SPORT) || (PROTOCOL == FRSKY_SPORT_HUB) ) )
106 #ifdef AIRSPEED_SENSOR_USE
107 #if ( AIRSPEED_SENSOR_USE == MS4525 )
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
122 #if ( CALCULATE_RPM == YES )
128 #ifdef A_GPS_IS_CONNECTED
129 #if ( A_GPS_IS_CONNECTED == YES )
130 #define GPS_INSTALLED
135 #ifdef A_MPU6050_IS_CONNECTED
136 #if ( A_MPU6050_IS_CONNECTED == YES )
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 )
151 #if defined( DISPLAY_ACC_OFFSET ) && defined ( A_MPU6050_IS_CONNECTED ) && ( A_MPU6050_IS_CONNECTED == YES )
154 #if defined( GENERATE_MAG_CALIBRATION_DATA ) && defined ( A_MPU6050_IS_CONNECTED ) && ( A_MPU6050_IS_CONNECTED == YES ) && defined ( USE_HMC5883 )