2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 #define USE_PARAMETER_GROUPS
24 // type conversion warnings.
25 // -Wconversion can be turned on to enable the process of eliminating these warnings
26 //#pragma GCC diagnostic warning "-Wconversion"
27 #pragma GCC diagnostic ignored "-Wsign-conversion"
28 // -Wpadded can be turned on to check padding of structs
29 //#pragma GCC diagnostic warning "-Wpadded"
31 //#define SCHEDULER_DEBUG // define this to use scheduler debug[] values. Undefined by default for performance reasons
32 #define DEBUG_MODE DEBUG_NONE // change this to change initial debug mode
34 #define I2C1_OVERCLOCK true
35 #define I2C2_OVERCLOCK true
39 // Using RX DMA disables the use of receive callbacks
40 #define USE_UART1_RX_DMA
41 #define USE_UART1_TX_DMA
47 #define USE_GYRO_DATA_ANALYSE
52 #if defined(STM32F40_41xxx)
56 #define USE_DSHOT_TELEMETRY
57 #define USE_RPM_FILTER
58 #define I2C3_OVERCLOCK true
59 #define USE_GYRO_DATA_ANALYSE
61 #define USE_ADC_INTERNAL
62 #define USE_USB_CDC_HID
64 #define USE_PERSISTENT_MSC_RTC
66 #define USE_TIMER_MGMT
67 // Re-enable this after 4.0 has been released, and remove the define from STM32F4DISCOVERY
68 //#define USE_SPI_TRANSACTION
70 #if defined(STM32F40_41xxx) || defined(STM32F411xE)
81 #define I2C3_OVERCLOCK true
82 #define I2C4_OVERCLOCK true
83 #define USE_GYRO_DATA_ANALYSE
85 #define USE_ADC_INTERNAL
86 #define USE_USB_CDC_HID
88 #define USE_PERSISTENT_MSC_RTC
91 #define USE_TIMER_MGMT
92 // Re-enable this after 4.0 has been released, and remove the define from STM32F4DISCOVERY
93 //#define USE_SPI_TRANSACTION
96 #if defined(STM32F4) || defined(STM32F7)
97 #define TASK_GYROPID_DESIRED_PERIOD 125 // 125us = 8kHz
98 #define SCHEDULER_DELAY_LIMIT 10
100 #define TASK_GYROPID_DESIRED_PERIOD 1000 // 1000us = 1kHz
101 #define SCHEDULER_DELAY_LIMIT 100
104 #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
105 #define DEFAULT_AUX_CHANNEL_COUNT MAX_AUX_CHANNEL_COUNT
107 #define DEFAULT_AUX_CHANNEL_COUNT 6
111 #define FAST_CODE __attribute__((section(".tcm_code")))
112 #define FAST_CODE_NOINLINE NOINLINE
115 #define FAST_CODE_NOINLINE
116 #endif // USE_ITCM_RAM
119 #define FAST_RAM_ZERO_INIT __attribute__ ((section(".fastram_bss"), aligned(4)))
120 #define FAST_RAM __attribute__ ((section(".fastram_data"), aligned(4)))
122 #define FAST_RAM_ZERO_INIT
124 #endif // USE_FAST_RAM
127 // Data in RAM which is guaranteed to not be reset on hot reboot
128 #define PERSISTENT __attribute__ ((section(".persistent_data"), aligned(4)))
132 #define SRAM2 __attribute__ ((section(".sram2"), aligned(4)))
137 #define USE_BRUSHED_ESC_AUTODETECT // Detect if brushed motors are connected and set defaults appropriately to avoid motors spinning on boot
140 #define USE_SERIAL_PASSTHROUGH
141 #define USE_TASK_STATISTICS
142 #define USE_GYRO_REGISTER_DUMP // Adds gyroregisters command to cli to dump configured register values
145 #define USE_SERIAL_RX
146 #define USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol
147 #define USE_SERIALRX_IBUS // FlySky and Turnigy receivers
148 #define USE_SERIALRX_SBUS // Frsky and Futaba receivers
149 #define USE_SERIALRX_SPEKTRUM // SRXL, DSM2 and DSMX protocol
150 #define USE_SERIALRX_SUMD // Graupner Hott protocol
152 #if (FLASH_SIZE > 128)
153 #define PID_PROFILE_COUNT 3
154 #define CONTROL_RATE_PROFILE_COUNT 6
156 #define PID_PROFILE_COUNT 2
157 #define CONTROL_RATE_PROFILE_COUNT 3
160 #if (FLASH_SIZE > 64)
161 #define USE_ACRO_TRAINER
163 #define USE_RESOURCE_MGMT
164 #define USE_RUNAWAY_TAKEOFF // Runaway Takeoff Prevention (anti-taz)
166 #define USE_TELEMETRY
167 #define USE_TELEMETRY_FRSKY_HUB
168 #define USE_TELEMETRY_SMARTPORT
171 #if (FLASH_SIZE > 128)
172 #define USE_GYRO_OVERFLOW_CHECK
173 #define USE_YAW_SPIN_RECOVERY
174 #define USE_DSHOT_DMAR
175 #define USE_SERIALRX_FPORT // FrSky FPort
176 #define USE_TELEMETRY_CRSF
177 #define USE_TELEMETRY_SRXL
179 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 12))
181 #define USE_MSP_DISPLAYPORT
182 #define USE_MSP_OVER_TELEMETRY
183 #define USE_LED_STRIP
186 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 11))
187 #define USE_VTX_COMMON
188 #define USE_VTX_CONTROL
189 #define USE_VTX_SMARTAUDIO
190 #define USE_VTX_TRAMP
193 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 10))
194 #define USE_VIRTUAL_CURRENT_METER
195 #define USE_CAMERA_CONTROL
196 #define USE_ESC_SENSOR
197 #define USE_SERIAL_4WAY_BLHELI_BOOTLOADER
201 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 9))
202 #define USE_GYRO_LPF2
205 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 8))
206 #define USE_LAUNCH_CONTROL
211 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 7))
212 #define USE_THROTTLE_BOOST
213 #define USE_INTEGRATED_YAW_CONTROL
216 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 6))
217 #define USE_ITERM_RELAX
218 #define USE_RC_SMOOTHING_FILTER
219 #define USE_THRUST_LINEARIZATION
223 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 5))
227 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 4))
233 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 3))
234 #ifdef USE_SERIALRX_SPEKTRUM
235 #define USE_SPEKTRUM_BIND
236 #define USE_SPEKTRUM_BIND_PLUG
237 #define USE_SPEKTRUM_REAL_RSSI
238 #define USE_SPEKTRUM_FAKE_RSSI
239 #define USE_SPEKTRUM_RSSI_PERCENT_CONVERSION
240 #define USE_SPEKTRUM_VTX_CONTROL
241 #define USE_SPEKTRUM_VTX_TELEMETRY
242 #define USE_SPEKTRUM_CMS_TELEMETRY
246 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 2))
247 #define USE_TELEMETRY_HOTT
248 #define USE_TELEMETRY_LTM
249 #define USE_SERIALRX_SUMH // Graupner legacy protocol
250 #define USE_SERIALRX_XBUS // JR
253 #if ((FLASH_SIZE > 256) || (FEATURE_CUT_LEVEL < 1))
254 #define USE_BOARD_INFO
255 #define USE_EXTENDED_CMS_MENUS
258 #define USE_ESC_SENSOR_INFO
259 #define USE_CRSF_CMS_TELEMETRY
262 #endif // FLASH_SIZE > 128
264 #if (FLASH_SIZE > 256)
265 #define USE_AIRMODE_LPF
266 #define USE_DASHBOARD
269 #define USE_GPS_UBLOX
270 #define USE_GPS_RESCUE
271 #define USE_GYRO_DLPF_EXPERIMENTAL
273 #define USE_OSD_OVER_MSP_DISPLAYPORT
274 #define USE_MULTI_GYRO
275 #define USE_OSD_ADJUSTMENTS
276 #define USE_SENSOR_NAMES
277 #define USE_SERIALRX_JETIEXBUS
278 #define USE_TELEMETRY_IBUS
279 #define USE_TELEMETRY_IBUS_EXTENDED
280 #define USE_TELEMETRY_JETIEXBUS
281 #define USE_TELEMETRY_MAVLINK
282 #define USE_UNCOMMON_MIXERS
283 #define USE_SIGNATURE
284 #define USE_ABSOLUTE_CONTROL
285 #define USE_HOTT_TEXTMODE
286 #define USE_LED_STRIP_STATUS_MODE
288 #define USE_RX_LINK_QUALITY_INFO
289 #define USE_ESC_SENSOR_TELEMETRY
290 #define USE_OSD_PROFILES
291 #define USE_OSD_STICK_OVERLAY
292 #define USE_ESCSERIAL_SIMONK
293 #define USE_SERIAL_4WAY_SK_BOOTLOADER
294 #define USE_CMS_FAILSAFE_MENU
295 #define USE_SMART_FEEDFORWARD
296 #define USE_TELEMETRY_SENSORS_DISABLED_DETAILS
297 // Re-enable this after 4.0 has been released, and remove the define from STM32F4DISCOVERY
298 //#define USE_VTX_TABLE