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
32 // Enable MSP_DISPLAYPORT for F3 targets without builtin OSD,
33 // since it's used to display CMS on MWOSD
34 #if !defined(USE_MSP_DISPLAYPORT) && (MCU_FLASH_SIZE > 128) && !defined(USE_OSD)
35 #define USE_MSP_DISPLAYPORT
38 #if defined(USE_OSD) && (MCU_FLASH_SIZE > 256)
42 // Enable MSP BARO & MAG drivers if BARO and MAG sensors are compiled in
52 #define USE_RPM_FILTER
56 #undef USE_WIND_ESTIMATOR
57 #undef USE_SERIALRX_SUMD
58 #undef USE_SERIALRX_SUMH
59 #undef USE_SERIALRX_XBUS
60 #undef USE_SERIALRX_JETIEXBUS
63 #ifndef BEEPER_PWM_FREQUENCY
64 #define BEEPER_PWM_FREQUENCY 2500
67 #define USE_ARM_MATH // try to use FPU functions
69 #if defined(SIMULATOR_BUILD) || defined(UNIT_TEST)
70 // This feature uses 'arm_math.h', which does not exist for x86.
71 #undef USE_DYNAMIC_FILTERS
75 //Defines for compiler optimizations
77 #define FUNCTION_COMPILE_FOR_SIZE __attribute__((optimize("-Os")))
78 #define FUNCTION_COMPILE_NORMAL __attribute__((optimize("-O2")))
79 #define FUNCTION_COMPILE_FOR_SPEED __attribute__((optimize("-Ofast")))
80 #define FILE_COMPILE_FOR_SIZE _Pragma("GCC optimize(\"Os\")")
81 #define FILE_COMPILE_NORMAL _Pragma("GCC optimize(\"O2\")")
82 #define FILE_COMPILE_FOR_SPEED _Pragma("GCC optimize(\"Ofast\")")
84 #define FUNCTION_COMPILE_FOR_SIZE
85 #define FUNCTION_COMPILE_NORMAL
86 #define FUNCTION_COMPILE_FOR_SPEED
87 #define FILE_COMPILE_FOR_SIZE
88 #define FILE_COMPILE_NORMAL
89 #define FILE_COMPILE_FOR_SPEED
92 #if defined(CONFIG_IN_RAM) || defined(CONFIG_IN_EXTERNAL_FLASH)
94 #define EEPROM_SIZE 8192
96 extern uint8_t eepromData
[EEPROM_SIZE
];
97 #define __config_start (*eepromData)
98 #define __config_end (*ARRAYEND(eepromData))
100 #ifndef CONFIG_IN_FLASH
101 #define CONFIG_IN_FLASH
103 extern uint8_t __config_start
; // configured via linker script when building binaries.
104 extern uint8_t __config_end
;