Defines
Betaflight uses #define
macro syntax to include software components that support additional features or specific hardware modules at build time.
A basic set of defines is included in the config file for each board. At build time, the user can add extra defines in the the Configurator's Firmware Flasher Tab.
When selecting GPS, Baro, etc from the Other Options
list, any additional required or related defines are added automatically. For example, if BARO
is requested by the user, the USE_BARO
define, and all supported baro hardware defines, are automatically included.
Additional defines may be added:
- to a cloud build, by entering the name of the define, without the
USE_
prefix, separated by spaces, in theCustom Defines
list, e.g.ANA EXTI
. - to a local build, by adding the define in a syntax matching the other defines,
e.g.
-DUSE_ANA -DUSE_EXTI
.
The user may review the full list of defines in the build by checking the build log after flashing. A link to the log appears in the Flashing tab once flashing is complete. Later, it can be loaded from Configurator's main Setup page, using the Log
button at bottom right. A summary of the included build options can also be displayed using the nearby Options
button.
A full list of defines as of May 2024 is provided below. The list was generated using grep --exclude-dir=config -Irh '^[^/].*' src/main/ | grep -wo 'USE_[0-9A-Z_]\+' | sort | uniq
Not all the defines in this list are 'safe'; some are archaic and some are not actively maintained. Defines on commented-out lines are not included in the list. Some defines are for internal register definitions and are not end-user code options.
USE_64BIT_TIME
USE_ABSOLUTE_CONTROL
USE_ACC
USE_ACCGYRO_BMI160
USE_ACCGYRO_BMI270
USE_ACCGYRO_LSM6DSO
USE_ACCGYRO_LSM6DSV16X
USE_ACC_ADXL345
USE_ACC_BMA280
USE_ACC_ICM20601
USE_ACC_ICM20602
USE_ACC_ICM20608G
USE_ACC_LSM303DLHC
USE_ACC_MMA8452
USE_ACC_MPU6000
USE_ACC_MPU6050
USE_ACC_MPU6500
USE_ACC_SPI_ICM20601
USE_ACC_SPI_ICM20602
USE_ACC_SPI_ICM20608G
USE_ACC_SPI_ICM20649
USE_ACC_SPI_ICM20689
USE_ACC_SPI_ICM42605
USE_ACC_SPI_ICM42688P
USE_ACC_SPI_MPU6000
USE_ACC_SPI_MPU6500
USE_ACC_SPI_MPU9250
USE_ACRO_TRAINER
USE_ADC
USE_ADC3_DIRECT_HAL_INIT
USE_ADC_INTERNAL
USE_ADC_INTERRUPT
USE_AIRMODE_LPF
USE_AKK_SMARTAUDIO
USE_ATBSP_DRIVER
USE_AUTO_ACKKNOWLEDGEMENT
USE_BARO
USE_BARO_2SMBP_02B
USE_BARO_BMP085
USE_BARO_BMP280
USE_BARO_BMP388
USE_BARO_DPS310
USE_BARO_LPS
USE_BARO_LPS22DF
USE_BARO_MS5611
USE_BARO_QMP6988
USE_BARO_SPI_2SMBP_02B
USE_BARO_SPI_BMP280
USE_BARO_SPI_BMP388
USE_BARO_SPI_DPS310
USE_BARO_SPI_LPS
USE_BARO_SPI_LPS22DF
USE_BARO_SPI_MS5611
USE_BARO_SPI_QMP6988
USE_BATTERY_CONTINUE
USE_BATTERY_VOLTAGE_SAG_COMPENSATION
USE_BEEPER
USE_BIND_ADDRESS_FOR_DATA_STATE
USE_BLACKBOX
USE_BOARD_INFO
USE_BRUSHED
USE_BST
USE_BUTTONS
USE_CAMERA_CONTROL
USE_CANVAS
USE_CCM_CODE
USE_CLI
USE_CLI_BATCH
USE_CLI_DEBUG_PRINT
USE_CMS
USE_CMS_FAILSAFE_MENU
USE_CMS_GPS_LAP_TIMER_MENU
USE_CMS_GPS_RESCUE_MENU
USE_CONFIG
USE_CRAFTNAME_MSGS
USE_CRSF_CMS_TELEMETRY
USE_CRSF_LINK_STATISTICS
USE_CRSF_OFFICIAL_SPEC
USE_CRSF_V3
USE_CRS_INTERRUPTS
USE_CUSTOM_BOX_NAMES
USE_DASHBOARD
USE_DEBUG_PIN
USE_DEVICE_MODE
USE_DMA
USE_DMA_MUX
USE_DMA_RAM
USE_DMA_REGISTER_CACHE
USE_DMA_SPEC
USE_DSHOT
USE_DSHOT_BB
USE_DSHOT_BITBAND
USE_DSHOT_BITBANG
USE_DSHOT_CACHE_MGMT
USE_DSHOT_DMAR
USE_DSHOT_TELEMETRY
USE_DSHOT_TELEMETRY_STATS
USE_DYN_IDLE
USE_DYN_LPF
USE_DYN_NOTCH_FILTER
USE_D_MIN
USE_EMBEDDED_PHY
USE_EMFAT_AUTORUN
USE_EMFAT_ICON
USE_EMFAT_README
USE_EMFAT_TOOLS
USE_ESCSERIAL
USE_ESCSERIAL_SIMONK
USE_ESC_SENSOR
USE_ESC_SENSOR_INFO
USE_ESC_SENSOR_TELEMETRY
USE_EXST
USE_EXTENDED_CMS_MENUS
USE_EXTENDED_SPI_DEVICE
USE_EXTI
USE_FAST_DATA
USE_FEEDFORWARD
USE_FIRMWARE_PARTITION
USE_FLASH
USE_FLASHFS
USE_FLASH_BOOT_LOADER
USE_FLASH_CHIP
USE_FLASH_M25P16
USE_FLASH_MEMORY_MAPPED
USE_FLASH_OCTOSPI
USE_FLASH_PY25Q128HA
USE_FLASH_QUADSPI
USE_FLASH_READS_USING_4LINES
USE_FLASH_SPI
USE_FLASH_TOOLS
USE_FLASH_W25M
USE_FLASH_W25M02G
USE_FLASH_W25M512
USE_FLASH_W25N01G
USE_FLASH_W25Q128FV
USE_FLASH_WRITES_USING_4LINES
USE_FRSKYOSD
USE_FULL_ASSERT
USE_FULL_LL_DRIVER
USE_GPS
USE_GPS_LAP_TIMER
USE_GPS_NMEA
USE_GPS_PLUS_CODES
USE_GPS_RESCUE
USE_GPS_UBLOX
USE_GYRO
USE_GYRO_DLPF_EXPERIMENTAL
USE_GYRO_EXTI
USE_GYRO_ICM20601
USE_GYRO_ICM20602
USE_GYRO_ICM20608G
USE_GYRO_L3G4200D
USE_GYRO_L3GD20
USE_GYRO_LPF2
USE_GYRO_MPU3050
USE_GYRO_MPU6000
USE_GYRO_MPU6050
USE_GYRO_MPU6500
USE_GYRO_OVERFLOW_CHECK
USE_GYRO_REGISTER_DUMP
USE_GYRO_SLEW_LIMITER
USE_GYRO_SPI_ICM20601
USE_GYRO_SPI_ICM20602
USE_GYRO_SPI_ICM20608G
USE_GYRO_SPI_ICM20649
USE_GYRO_SPI_ICM20689
USE_GYRO_SPI_ICM42605
USE_GYRO_SPI_ICM42688P
USE_GYRO_SPI_MPU6000
USE_GYRO_SPI_MPU6500
USE_GYRO_SPI_MPU9250
USE_H7_HSERDY_SLOW_WORKAROUND
USE_H7_HSE_TIMEOUT_WORKAROUND
USE_HAL_ADC_REGISTER_CALLBACKS
USE_HAL_CEC_REGISTER_CALLBACKS
USE_HAL_COMP_REGISTER_CALLBACKS
USE_HAL_CORDIC_REGISTER_CALLBACKS
USE_HAL_CRYP_REGISTER_CALLBACKS
USE_HAL_DAC_REGISTER_CALLBACKS
USE_HAL_DCMI_REGISTER_CALLBACKS
USE_HAL_DFSDM_REGISTER_CALLBACKS
USE_HAL_DMA2D_REGISTER_CALLBACKS
USE_HAL_DRIVER
USE_HAL_DSI_REGISTER_CALLBACKS
USE_HAL_DTS_REGISTER_CALLBACKS
USE_HAL_ETH_REGISTER_CALLBACKS
USE_HAL_EXTI_REGISTER_CALLBACKS
USE_HAL_FDCAN_REGISTER_CALLBACKS
USE_HAL_FMAC_REGISTER_CALLBACKS
USE_HAL_GFXMMU_REGISTER_CALLBACKS
USE_HAL_HASH_REGISTER_CALLBACKS
USE_HAL_HCD_REGISTER_CALLBACKS
USE_HAL_HRTIM_REGISTER_CALLBACKS
USE_HAL_I2C_REGISTER_CALLBACKS
USE_HAL_I2S_REGISTER_CALLBACKS
USE_HAL_IRDA_REGISTER_CALLBACKS
USE_HAL_JPEG_REGISTER_CALLBACKS
USE_HAL_LPTIM_REGISTER_CALLBACKS
USE_HAL_LTDC_REGISTER_CALLBACKS
USE_HAL_MDIOS_REGISTER_CALLBACKS
USE_HAL_MMC_REGISTER_CALLBACKS
USE_HAL_NAND_REGISTER_CALLBACKS
USE_HAL_NOR_REGISTER_CALLBACKS
USE_HAL_OPAMP_REGISTER_CALLBACKS
USE_HAL_OSPI_REGISTER_CALLBACKS
USE_HAL_OTFDEC_REGISTER_CALLBACKS
USE_HAL_PCD_REGISTER_CALLBACK
USE_HAL_PCD_REGISTER_CALLBACKS
USE_HAL_QSPI_REGISTER_CALLBACKS
USE_HAL_RNG_REGISTER_CALLBACKS
USE_HAL_RTC_REGISTER_CALLBACKS
USE_HAL_SAI_REGISTER_CALLBACKS
USE_HAL_SDRAM_REGISTER_CALLBACKS
USE_HAL_SD_REGISTER_CALLBACKS
USE_HAL_SMARTCARD_REGISTER_CALLBACKS
USE_HAL_SMBUS_REGISTER_CALLBACKS
USE_HAL_SPDIFRX_REGISTER_CALLBACKS
USE_HAL_SPI_REGISTER_CALLBACKS
USE_HAL_SRAM_REGISTER_CALLBACKS
USE_HAL_SWPMI_REGISTER_CALLBACKS
USE_HAL_TIM_REGISTER_CALLBACKS
USE_HAL_UART_REGISTER_CALLBACKS
USE_HAL_USART_REGISTER_CALLBACKS
USE_HAL_WWDG_REGISTER_CALLBACKS
USE_HARDWARE_REVISION_DETECTION
USE_HOST_MODE
USE_HOTT_TEXTMODE
USE_HUFFMAN
USE_I2C
USE_I2C_DEVICE_1
USE_I2C_DEVICE_2
USE_I2C_DEVICE_3
USE_I2C_DEVICE_4
USE_I2C_DEVICE_5
USE_I2C_GYRO
USE_I2C_OLED_DISPLAY
USE_I2C_PHY
USE_I2C_PULLUP
USE_IMU_CALC
USE_INTEGRATED_YAW_CONTROL
USE_INVERTER
USE_ITCM_RAM
USE_ITERM_RELAX
USE_LATE_TASK_STATISTICS
USE_LAUNCH_CONTROL
USE_LED_STRIP
USE_LED_STRIP_64
USE_LED_STRIP_CACHE_MGMT
USE_LED_STRIP_STATUS_MODE
USE_LPUART1
USE_MAG
USE_MAG_AK8963
USE_MAG_AK8975
USE_MAG_DATA_READY_SIGNAL
USE_MAG_HMC5883
USE_MAG_IST8310
USE_MAG_LIS2MDL
USE_MAG_LIS3MDL
USE_MAG_MPU925X_AK8963
USE_MAG_QMC5883
USE_MAG_SPI_AK8963
USE_MAG_SPI_HMC5883
USE_MAX7456
USE_MCO
USE_MCO_OUTPUTS
USE_MOTOR
USE_MPU9250_MAG
USE_MSP_CURRENT_METER
USE_MSP_DISPLAYPORT
USE_MSP_OVER_TELEMETRY
USE_MSP_PUSH_OVER_VCP
USE_MSP_UART
USE_MULTISHOT
USE_MULTI_GYRO
USE_OCTOSPI
USE_OCTOSPI_DEVICE_1
USE_OCTOSPI_EXPERIMENTAL
USE_OLED_GPS_DEBUG_PAGE_ONLY
USE_ONESHOT
USE_OSD
USE_OSD_ADJUSTMENTS
USE_OSD_HD
USE_OSD_OVER_MSP_DISPLAYPORT
USE_OSD_PROFILES
USE_OSD_QUICK_MENU
USE_OSD_SD
USE_OSD_STICK_OVERLAY
USE_OTG_DEVICE_MODE
USE_OTG_HOST_MODE
USE_OVERCLOCK
USE_OVERRIDE_SOFTSERIAL_BAUDRATE
USE_PARAMETER_GROUPS
USE_PERSISTENT_MSC_RTC
USE_PERSISTENT_OBJECTS
USE_PERSISTENT_STATS
USE_PID_AUDIO
USE_PID_DENOM_CHECK
USE_PID_DENOM_OVERCLOCK_LEVEL
USE_PINIO
USE_PINIOBOX
USE_PIN_AF
USE_PIN_PULL_UP_DOWN
USE_PROFILE_NAMES
USE_PROSHOT
USE_PWM_OUTPUT
USE_QUADSPI
USE_QUADSPI_DEVICE_1
USE_QUAD_MIXER_ONLY
USE_RACE_PRO
USE_RAM_CODE
USE_RANGEFINDER
USE_RANGEFINDER_HCSR04
USE_RANGEFINDER_HCSR04_I2C
USE_RANGEFINDER_SRF10
USE_RANGEFINDER_TF
USE_RANGEFINDER_UIB
USE_RANGEFINDER_VL53L0X
USE_RCDEVICE
USE_RC_SMOOTHING_FILTER
USE_RC_STATS
USE_RESOURCE_MGMT
USE_RPM_FILTER
USE_RPM_LIMIT
USE_RTC_TIME
USE_RTOS
USE_RUNAWAY_TAKEOFF
USE_RX_BIND
USE_RX_CC2500
USE_RX_CC2500_SPI_DIVERSITY
USE_RX_CC2500_SPI_PA_LNA
USE_RX_CX10
USE_RX_EXPRESSLRS
USE_RX_FLYSKY
USE_RX_FLYSKY_SPI_LED
USE_RX_FRSKY_SPI
USE_RX_FRSKY_SPI_D
USE_RX_FRSKY_SPI_TELEMETRY
USE_RX_FRSKY_SPI_X
USE_RX_H8_3D
USE_RX_INAV
USE_RX_KN
USE_RX_LINK_QUALITY_INFO
USE_RX_LINK_UPLINK_POWER
USE_RX_MSP
USE_RX_MSP_OVERRIDE
USE_RX_NRF24
USE_RX_PPM
USE_RX_PWM
USE_RX_REDPINE_SPI
USE_RX_RSNR
USE_RX_RSSI_DBM
USE_RX_SFHSS_SPI
USE_RX_SPEKTRUM
USE_RX_SPEKTRUM_TELEMETRY
USE_RX_SPI
USE_RX_SX127X
USE_RX_SX1280
USE_RX_SYMA
USE_RX_V202
USE_RX_XN297
USE_SBUS_CHANNELS
USE_SDCARD
USE_SDCARD_SDIO
USE_SDCARD_SPI
USE_SD_TRANSCEIVER
USE_SENSOR_NAMES
USE_SERIALRX
USE_SERIALRX_CRSF
USE_SERIALRX_FPORT
USE_SERIALRX_GHST
USE_SERIALRX_IBUS
USE_SERIALRX_JETIEXBUS
USE_SERIALRX_SBUS
USE_SERIALRX_SPEKTRUM
USE_SERIALRX_SRXL2
USE_SERIALRX_SUMD
USE_SERIALRX_SUMH
USE_SERIALRX_TARGET_CUSTOM
USE_SERIALRX_XBUS
USE_SERIAL_4WAY_BLHELI_BOOTLOADER
USE_SERIAL_4WAY_BLHELI_INTERFACE
USE_SERIAL_4WAY_SK_BOOTLOADER
USE_SERIAL_PASSTHROUGH
USE_SERIAL_RX
USE_SERVOS
USE_SIGNATURE
USE_SIMPLIFIED_TUNING
USE_SMARTAUDIO_DPRINTF
USE_SOFTSERIAL
USE_SOFT_I2C
USE_SPEC_PREARM_SCREEN
USE_SPEKTRUM_BIND
USE_SPEKTRUM_BIND_PLUG
USE_SPEKTRUM_CMS_TELEMETRY
USE_SPEKTRUM_REAL_RSSI
USE_SPEKTRUM_REGION_CODES
USE_SPEKTRUM_RSSI_PERCENT_CONVERSION
USE_SPEKTRUM_VIRTUAL_RSSI
USE_SPEKTRUM_VTX_CONTROL
USE_SPEKTRUM_VTX_TELEMETRY
USE_SPI
USE_SPI_CRC
USE_SPI_DEVICE_1
USE_SPI_DEVICE_2
USE_SPI_DEVICE_3
USE_SPI_DEVICE_4
USE_SPI_DEVICE_5
USE_SPI_DEVICE_6
USE_SPI_DMA_ENABLE_EARLY
USE_SPI_DMA_ENABLE_LATE
USE_SPI_GYRO
USE_SPI_MAG
USE_SPRACING_PERSISTENT_RTC_WORKAROUND
USE_STACK_CHECK
USE_STDPERIPH_DRIVER
USE_STM3210C_EVAL
USE_TARGET_CONFIG
USE_TELEMETRY
USE_TELEMETRY_CRSF
USE_TELEMETRY_FRSKY_HUB
USE_TELEMETRY_GHST
USE_TELEMETRY_HOTT
USE_TELEMETRY_IBUS
USE_TELEMETRY_IBUS_EXTENDED
USE_TELEMETRY_JETIEXBUS
USE_TELEMETRY_LTM
USE_TELEMETRY_MAVLINK
USE_TELEMETRY_NRF24_LTM
USE_TELEMETRY_SENSORS_DISABLED_DETAILS
USE_TELEMETRY_SMARTPORT
USE_TELEMETRY_SRXL
USE_THROTTLE_BOOST
USE_THRUST_LINEARIZATION
USE_TIMEOUT_4WAYIF
USE_TIMER
USE_TIMER_AF
USE_TIMER_DMA
USE_TIMER_MAP_PRINT
USE_TIMER_MGMT
USE_TIMER_UP_CONFIG
USE_TPA_MODE
USE_TRANSPONDER
USE_TXRX_LED
USE_TX_IRQ_HANDLER
USE_UART
USE_UART1
USE_UART10
USE_UART1_RX_DMA
USE_UART1_TX_DMA
USE_UART2
USE_UART2_RX_DMA
USE_UART2_TX_DMA
USE_UART3
USE_UART3_RX_DMA
USE_UART3_TX_DMA
USE_UART4
USE_UART4_RX_DMA
USE_UART4_TX_DMA
USE_UART5
USE_UART5_RX_DMA
USE_UART5_TX_DMA
USE_UART6
USE_UART6_RX_DMA
USE_UART6_TX_DMA
USE_UART7
USE_UART7_RX_DMA
USE_UART7_TX_DMA
USE_UART8
USE_UART8_RX_DMA
USE_UART8_TX_DMA
USE_UART9
USE_ULPI_PHY
USE_UNCOMMON_MIXERS
USE_USB_ADVANCED_PROFILES
USE_USB_CDC_HID
USE_USB_DETECT
USE_USB_FS
USE_USB_HS
USE_USB_HS_IN_FS
USE_USB_ID
USE_USB_MSC
USE_USB_OTG_FS
USE_USB_OTG_HS
USE_VARIO
USE_VCP
USE_VIDEO_SYSTEM
USE_VIRTUAL_ACC
USE_VIRTUAL_BARO
USE_VIRTUAL_CURRENT_METER
USE_VIRTUAL_ESC
USE_VIRTUAL_GYRO
USE_VIRTUAL_LED
USE_VIRTUAL_MAG
USE_VTX
USE_VTX_COMMON
USE_VTX_COMMON_FREQ_API
USE_VTX_CONTROL
USE_VTX_MSP
USE_VTX_RTC6705
USE_VTX_RTC6705_SOFTSPI
USE_VTX_SMARTAUDIO
USE_VTX_TABLE
USE_VTX_TRAMP
USE_WS2811_SINGLE_COLOUR
USE_YAW_SPIN_RECOVERY