2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 // Touch up configuration
22 // Config storage in memory-mapped flash
23 extern uint8_t __config_start
;
24 extern uint8_t __config_end
;
26 // Backward compatibility for I2C OLED display
29 # undef USE_OLED_UG2864
33 // Make sure DEFAULT_I2C_BUS is valid
34 #ifndef DEFAULT_I2C_BUS
36 #if defined(USE_I2C_DEVICE_1)
37 #define DEFAULT_I2C_BUS BUS_I2C1
38 #elif defined(USE_I2C_DEVICE_2)
39 #define DEFAULT_I2C_BUS BUS_I2C2
40 #elif defined(USE_I2C_DEVICE_3)
41 #define DEFAULT_I2C_BUS BUS_I2C3
42 #elif defined(USE_I2C_DEVICE_4)
43 #define DEFAULT_I2C_BUS BUS_I2C4
49 #if defined(USE_PITOT) && defined(DEFAULT_I2C_BUS)
52 #define PITOT_I2C_BUS DEFAULT_I2C_BUS
57 // Temperature sensors
58 #if !defined(TEMPERATURE_I2C_BUS) && defined(DEFAULT_I2C_BUS)
59 #define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
62 // Rangefinder sensors
63 #if !defined(RANGEFINDER_I2C_BUS) && defined(DEFAULT_I2C_BUS)
64 #define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS
67 // Enable MSP_DISPLAYPORT for F3 targets without builtin OSD,
68 // since it's used to display CMS on MWOSD
69 #if !defined(USE_MSP_DISPLAYPORT) && !defined(USE_OSD)
70 #define USE_MSP_DISPLAYPORT
77 // Enable MSP BARO & MAG drivers if BARO and MAG sensors are compiled in
81 #if defined(USE_MAG_ALL)
83 #define USE_MAG_HMC5883
84 #define USE_MAG_IST8310
85 #define USE_MAG_LIS3MDL
86 #define USE_MAG_MAG3110
87 #define USE_MAG_QMC5883
89 //#if (MCU_FLASH_SIZE > 512)
90 #define USE_MAG_AK8963
91 #define USE_MAG_AK8975
92 #define USE_MAG_IST8308
93 #define USE_MAG_MLX90393
95 #if defined(USE_IMU_MPU9250)
96 #define USE_MAG_MPU9250
99 #define USE_MAG_RM3100
100 #define USE_MAG_VCM5883
101 //#endif // MCU_FLASH_SIZE
103 #endif // USE_MAG_ALL
105 #if defined(DEFAULT_I2C_BUS) && !defined(MAG_I2C_BUS)
106 #define MAG_I2C_BUS DEFAULT_I2C_BUS
111 #if defined(USE_BARO)
114 #if defined(USE_BARO_ALL)
115 #define USE_BARO_BMP085
116 #define USE_BARO_BMP280
117 #define USE_BARO_BMP388
118 #define USE_BARO_BMP390
119 #define USE_BARO_DPS310
120 #define USE_BARO_LPS25H
121 #define USE_BARO_MS5607
122 #define USE_BARO_MS5611
123 //#define USE_BARO_SPI_BMP280
124 #define USE_BARO_SPL06
127 #if defined(DEFAULT_I2C_BUS) && !defined(BARO_I2C_BUS)
128 #define BARO_I2C_BUS DEFAULT_I2C_BUS
133 #ifdef USE_ESC_SENSOR
134 #define USE_RPM_FILTER
137 #ifndef BEEPER_PWM_FREQUENCY
138 #define BEEPER_PWM_FREQUENCY 2500
141 #define USE_ARM_MATH // try to use FPU functions
143 #if defined(SITL_BUILD) || defined(UNIT_TEST)
144 // This feature uses 'arm_math.h', which does not exist for x86.
145 #undef USE_DYNAMIC_FILTERS
149 #if defined(CONFIG_IN_RAM) || defined(CONFIG_IN_FILE) || defined(CONFIG_IN_EXTERNAL_FLASH)
151 #define EEPROM_SIZE 8192
153 extern uint8_t eepromData
[EEPROM_SIZE
];
154 #define __config_start (*eepromData)
155 #define __config_end (*ARRAYEND(eepromData))
157 #ifndef CONFIG_IN_FLASH
158 #define CONFIG_IN_FLASH
160 extern uint8_t __config_start
; // configured via linker script when building binaries.
161 extern uint8_t __config_end
;