Finishing off Makefile changes removing target specifics
This commit is contained in:
parent
6234652e7d
commit
addfbe4ffe
519
Makefile
519
Makefile
|
@ -57,29 +57,14 @@ LINKER_DIR = $(ROOT)/src/main/target
|
||||||
HSE_VALUE = 8000000
|
HSE_VALUE = 8000000
|
||||||
|
|
||||||
# used for turning on features like VCP and SDCARD
|
# used for turning on features like VCP and SDCARD
|
||||||
OPTIONS =
|
FEATURES =
|
||||||
|
|
||||||
CC3D_TARGETS = CC3D CC3D_OPBL
|
F405_TARGETS =
|
||||||
NAZE_TARGETS = AFROMINI ALIENFLIGHTF1
|
|
||||||
SPRACINGF3_TARGETS = IRCFUSIONF3 RMDO
|
|
||||||
|
|
||||||
SDCARD_TARGETS = ALIENFLIGHTF4 AQ32_V2 FURYF3 FURYF4 SPRACINGF3MINI
|
|
||||||
SERIAL_USB_TARGETS = IRCFUSIONF3 SPRACINGF3
|
|
||||||
|
|
||||||
# Valid targets for STM VCP support
|
|
||||||
VCP_TARGETS = $(CC3D_TARGETS) ALIENFLIGHTF3 CHEBUZZF3 COLIBRI_RACE LUX_RACE MOTOLAB NAZE32PRO SPARKY SPRACINGF3EVO SPRACINGF3MINI STM32F3DISCOVERY FURYF3 FURYF4 REVO
|
|
||||||
|
|
||||||
# Valid targets for OP BootLoader support
|
|
||||||
OPBL_TARGETS = CC3D_OPBL
|
|
||||||
|
|
||||||
F405_TARGETS = ALIENFLIGHTF4 FURYF4 REVO
|
|
||||||
F411_TARGETS =
|
F411_TARGETS =
|
||||||
|
|
||||||
# silently ignore if the file is not present. Allows for target specific.
|
# silently ignore if the file is not present. Allows for target specific.
|
||||||
-include $(ROOT)/src/main/target/$(TARGET)/target.mk
|
-include $(ROOT)/src/main/target/$(TARGET)/target.mk
|
||||||
|
|
||||||
F1_TARGETS += $(CC3D_TARGETS) AFROMINI ALIENFLIGHTF1 NAZE OLIMEXINO PORT103R
|
|
||||||
F3_TARGETS += ALIENFLIGHTF3 CHEBUZZF3 COLIBRI_RACE DOGE FURYF3 IRCFUSIONF3 KISSFC LUX_RACE MOTOLAB NAZE32PRO RMDO SINGULARITY SPARKY SPRACINGF3 SPRACINGF3EVO SPRACINGF3MINI STM32F3DISCOVERY
|
|
||||||
F4_TARGETS = $(F405_TARGETS) $(F411_TARGETS)
|
F4_TARGETS = $(F405_TARGETS) $(F411_TARGETS)
|
||||||
|
|
||||||
VALID_TARGETS = $(F1_TARGETS) $(F3_TARGETS) $(F4_TARGETS)
|
VALID_TARGETS = $(F1_TARGETS) $(F3_TARGETS) $(F4_TARGETS)
|
||||||
|
@ -88,33 +73,21 @@ ifeq ($(filter $(TARGET),$(VALID_TARGETS)),)
|
||||||
$(error Target '$(TARGET)' is not valid, must be one of $(VALID_TARGETS))
|
$(error Target '$(TARGET)' is not valid, must be one of $(VALID_TARGETS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# can get rid of these if all targets that want options get a target.mk
|
128K_TARGETS = $(F1_TARGETS)
|
||||||
ifeq ($(TARGET),$(filter $(TARGET),$(SDCARD_TARGETS)))
|
256K_TARGETS = $(F3_TARGETS)
|
||||||
OPTIONS += SDCARD
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(TARGET),$(filter $(TARGET),$(VCP_TARGETS)))
|
|
||||||
OPTIONS += VCP
|
|
||||||
endif
|
|
||||||
|
|
||||||
64K_TARGETS = CJMCU
|
|
||||||
128K_TARGETS = $(CC3D_TARGETS) AFROMINI ALIENFLIGHTF1 NAZE OLIMEXINO RMDO
|
|
||||||
256K_TARGETS = $(F3_TARGETS) EUSTM32F103RC PORT103R
|
|
||||||
512K_TARGETS = $(F411_TARGETS)
|
512K_TARGETS = $(F411_TARGETS)
|
||||||
1024K_TARGETS = $(F405_TARGETS)
|
1024K_TARGETS = $(F405_TARGETS)
|
||||||
|
|
||||||
# Configure default flash sizes for the targets
|
# Configure default flash sizes for the targets (largest size specified gets hit first)
|
||||||
ifeq ($(FLASH_SIZE),)
|
ifeq ($(FLASH_SIZE),)
|
||||||
ifeq ($(TARGET),$(filter $(TARGET),$(64K_TARGETS)))
|
ifeq ($(TARGET),$(filter $(TARGET),$(1024K_TARGETS)))
|
||||||
FLASH_SIZE = 64
|
FLASH_SIZE = 1024
|
||||||
else ifeq ($(TARGET),$(filter $(TARGET),$(128K_TARGETS)))
|
|
||||||
FLASH_SIZE = 128
|
|
||||||
else ifeq ($(TARGET),$(filter $(TARGET),$(256K_TARGETS)))
|
|
||||||
FLASH_SIZE = 256
|
|
||||||
else ifeq ($(TARGET),$(filter $(TARGET),$(512K_TARGETS)))
|
else ifeq ($(TARGET),$(filter $(TARGET),$(512K_TARGETS)))
|
||||||
FLASH_SIZE = 512
|
FLASH_SIZE = 512
|
||||||
else ifeq ($(TARGET),$(filter $(TARGET),$(1024K_TARGETS)))
|
else ifeq ($(TARGET),$(filter $(TARGET),$(256K_TARGETS)))
|
||||||
FLASH_SIZE = 1024
|
FLASH_SIZE = 256
|
||||||
|
else ifeq ($(TARGET),$(filter $(TARGET),$(128K_TARGETS)))
|
||||||
|
FLASH_SIZE = 128
|
||||||
else
|
else
|
||||||
$(error FLASH_SIZE not configured for target $(TARGET))
|
$(error FLASH_SIZE not configured for target $(TARGET))
|
||||||
endif
|
endif
|
||||||
|
@ -166,7 +139,7 @@ INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
||||||
$(CMSIS_DIR)/CM1/CoreSupport \
|
$(CMSIS_DIR)/CM1/CoreSupport \
|
||||||
$(CMSIS_DIR)/CM1/DeviceSupport/ST/STM32F30x
|
$(CMSIS_DIR)/CM1/DeviceSupport/ST/STM32F30x
|
||||||
|
|
||||||
ifneq ($(TARGET),$(filter $(TARGET), $(SERIAL_USB_TARGETS)))
|
ifneq ($(filter VCP, $(FEATURES)),)
|
||||||
INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
||||||
$(USBFS_DIR)/inc \
|
$(USBFS_DIR)/inc \
|
||||||
$(ROOT)/src/main/vcp
|
$(ROOT)/src/main/vcp
|
||||||
|
@ -175,10 +148,9 @@ VPATH := $(VPATH):$(USBFS_DIR)/src
|
||||||
|
|
||||||
DEVICE_STDPERIPH_SRC := $(DEVICE_STDPERIPH_SRC)\
|
DEVICE_STDPERIPH_SRC := $(DEVICE_STDPERIPH_SRC)\
|
||||||
$(USBPERIPH_SRC)
|
$(USBPERIPH_SRC)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter SDCARD, $(OPTIONS)),)
|
ifneq ($(filter SDCARD, $(FEATURES)),)
|
||||||
INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
||||||
$(FATFS_DIR) \
|
$(FATFS_DIR) \
|
||||||
|
|
||||||
|
@ -263,7 +235,7 @@ INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
||||||
$(CMSIS_DIR)/CM4/DeviceSupport/ST/STM32F4xx \
|
$(CMSIS_DIR)/CM4/DeviceSupport/ST/STM32F4xx \
|
||||||
$(ROOT)/src/main/vcpf4
|
$(ROOT)/src/main/vcpf4
|
||||||
|
|
||||||
ifneq ($(filter SDCARD,$(OPTIONS)),)
|
ifneq ($(filter SDCARD,$(FEATURES)),)
|
||||||
INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
||||||
$(FATFS_DIR)
|
$(FATFS_DIR)
|
||||||
VPATH := $(VPATH):$(FATFS_DIR)
|
VPATH := $(VPATH):$(FATFS_DIR)
|
||||||
|
@ -309,7 +281,7 @@ INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
||||||
|
|
||||||
DEVICE_STDPERIPH_SRC = $(STDPERIPH_SRC)
|
DEVICE_STDPERIPH_SRC = $(STDPERIPH_SRC)
|
||||||
|
|
||||||
ifeq ($(TARGET),$(filter $(TARGET),$(VCP_TARGETS)))
|
ifneq ($(filter VCP, $(FEATURES)),)
|
||||||
INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
||||||
$(USBFS_DIR)/inc \
|
$(USBFS_DIR)/inc \
|
||||||
$(ROOT)/src/main/vcp
|
$(ROOT)/src/main/vcp
|
||||||
|
@ -323,12 +295,10 @@ endif
|
||||||
|
|
||||||
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f103_$(FLASH_SIZE)k.ld
|
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f103_$(FLASH_SIZE)k.ld
|
||||||
ARCH_FLAGS = -mthumb -mcpu=cortex-m3
|
ARCH_FLAGS = -mthumb -mcpu=cortex-m3
|
||||||
TARGET_FLAGS = -D$(TARGET) -pedantic
|
TARGET_FLAGS := -D$(TARGET) -pedantic $(TARGET_FLAGS)
|
||||||
|
|
||||||
ifeq ($(TARGET),$(filter $(TARGET),EUSTM32F103RC PORT103R))
|
ifeq ($(DEVICE_FLAGS),)
|
||||||
DEVICE_FLAGS = -DSTM32F10X_MD
|
DEVICE_FLAGS = -DSTM32F10X_MD
|
||||||
else
|
|
||||||
DEVICE_FLAGS = -DSTM32F10X_HD
|
|
||||||
endif
|
endif
|
||||||
DEVICE_FLAGS += -DSTM32F10X
|
DEVICE_FLAGS += -DSTM32F10X
|
||||||
|
|
||||||
|
@ -351,38 +321,24 @@ ifeq ($(TARGET),CHEBUZZF3)
|
||||||
TARGET_FLAGS := $(TARGET_FLAGS) -DSTM32F3DISCOVERY
|
TARGET_FLAGS := $(TARGET_FLAGS) -DSTM32F3DISCOVERY
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGET),$(filter $(TARGET),$(SPRACINGF3_TARGETS)))
|
|
||||||
# VARIANTS of SPRACINGF3
|
|
||||||
TARGET_FLAGS := $(TARGET_FLAGS) -DSPRACINGF3
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(TARGET),$(filter $(TARGET), $(NAZE_TARGETS)))
|
ifeq ($(TARGET),$(filter $(TARGET), $(NAZE_TARGETS)))
|
||||||
# VARIANTS of NAZE
|
# VARIANTS of NAZE
|
||||||
TARGET_FLAGS := $(TARGET_FLAGS) -DNAZE -D$(TARGET)
|
TARGET_FLAGS := $(TARGET_FLAGS) -DNAZE -D$(TARGET)
|
||||||
TARGET_DIR = $(ROOT)/src/main/target/NAZE
|
TARGET_DIR = $(ROOT)/src/main/target/NAZE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGET),$(filter $(TARGET), $(CC3D_TARGETS)))
|
|
||||||
TARGET_FLAGS := $(TARGET_FLAGS) -DCC3D
|
|
||||||
ifeq ($(TARGET),CC3D_OPBL)
|
|
||||||
TARGET_FLAGS := $(TARGET_FLAGS) -DCC3D_OPBL
|
|
||||||
CC3D_OPBL_SRC = $(CC3D_SRC)
|
|
||||||
endif
|
|
||||||
TARGET_DIR = $(ROOT)/src/main/target/CC3D
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(filter $(TARGET),$(OPBL_TARGETS)),)
|
|
||||||
OPBL=yes
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OPBL),yes)
|
ifeq ($(OPBL),yes)
|
||||||
ifneq ($(filter $(TARGET),$(OPBL_TARGETS)),)
|
|
||||||
TARGET_FLAGS := -DOPBL $(TARGET_FLAGS)
|
TARGET_FLAGS := -DOPBL $(TARGET_FLAGS)
|
||||||
|
ifeq ($(TARGET), $(filter $(TARGET),$(F405_TARGETS)))
|
||||||
|
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f405_opbl.ld
|
||||||
|
else ifeq ($(TARGET), $(filter $(TARGET),$(F411_TARGETS)))
|
||||||
|
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f411_opbl.ld
|
||||||
|
else ifeq ($(TARGET), $(filter $(TARGET),$(F3_TARGETS)))
|
||||||
|
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f303_$(FLASH_SIZE)k_opbl.ld
|
||||||
|
else ifeq ($(TARGET), $(filter $(TARGET),$(F1_TARGETS)))
|
||||||
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f103_$(FLASH_SIZE)k_opbl.ld
|
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f103_$(FLASH_SIZE)k_opbl.ld
|
||||||
.DEFAULT_GOAL := binary
|
|
||||||
else
|
|
||||||
$(error OPBL specified with a unsupported target)
|
|
||||||
endif
|
endif
|
||||||
|
.DEFAULT_GOAL := binary
|
||||||
endif
|
endif
|
||||||
|
|
||||||
INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
INCLUDE_DIRS := $(INCLUDE_DIRS) \
|
||||||
|
@ -534,415 +490,7 @@ STM32F4xx_COMMON_SRC = \
|
||||||
drivers/serial_uart_stm32f4xx.c \
|
drivers/serial_uart_stm32f4xx.c \
|
||||||
drivers/system_stm32f4xx.c \
|
drivers/system_stm32f4xx.c \
|
||||||
drivers/timer_stm32f4xx.c \
|
drivers/timer_stm32f4xx.c \
|
||||||
drivers/dma_stm32f4xx.c \
|
drivers/dma_stm32f4xx.c
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
io/flashfs.c
|
|
||||||
|
|
||||||
NAZE_SRC = \
|
|
||||||
$(STM32F10x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_adxl345.c \
|
|
||||||
drivers/accgyro_bma280.c \
|
|
||||||
drivers/accgyro_l3g4200d.c \
|
|
||||||
drivers/accgyro_mma845x.c \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu3050.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
|
||||||
drivers/barometer_bmp085.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f10x.c \
|
|
||||||
drivers/sonar_hcsr04.c \
|
|
||||||
io/flashfs.c \
|
|
||||||
hardware_revision.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC)
|
|
||||||
|
|
||||||
ALIENFLIGHTF1_SRC = $(NAZE_SRC)
|
|
||||||
|
|
||||||
AFROMINI_SRC = $(NAZE_SRC)
|
|
||||||
|
|
||||||
EUSTM32F103RC_SRC = \
|
|
||||||
$(STM32F10x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_adxl345.c \
|
|
||||||
drivers/accgyro_bma280.c \
|
|
||||||
drivers/accgyro_l3g4200d.c \
|
|
||||||
drivers/accgyro_mma845x.c \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu3050.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/accgyro_spi_mpu6000.c \
|
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
|
||||||
drivers/barometer_bmp085.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/compass_ak8975.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f10x.c \
|
|
||||||
drivers/sonar_hcsr04.c \
|
|
||||||
io/flashfs.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC)
|
|
||||||
|
|
||||||
PORT103R_SRC = $(EUSTM32F103RC_SRC)
|
|
||||||
|
|
||||||
OLIMEXINO_SRC = \
|
|
||||||
$(STM32F10x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/barometer_bmp085.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f10x.c \
|
|
||||||
drivers/sonar_hcsr04.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC)
|
|
||||||
|
|
||||||
CJMCU_SRC = \
|
|
||||||
$(STM32F10x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
hardware_revision.c \
|
|
||||||
flight/gtune.c \
|
|
||||||
blackbox/blackbox.c \
|
|
||||||
blackbox/blackbox_io.c \
|
|
||||||
$(COMMON_SRC)
|
|
||||||
|
|
||||||
CC3D_SRC = \
|
|
||||||
$(STM32F10x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_spi_mpu6000.c \
|
|
||||||
drivers/barometer_bmp085.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f10x.c \
|
|
||||||
drivers/sonar_hcsr04.c \
|
|
||||||
io/flashfs.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
NAZE32PRO_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
STM32F3DISCOVERY_COMMON_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/accgyro_l3gd20.c \
|
|
||||||
drivers/accgyro_lsm303dlhc.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
STM32F3DISCOVERY_SRC = \
|
|
||||||
$(STM32F3DISCOVERY_COMMON_SRC) \
|
|
||||||
drivers/accgyro_adxl345.c \
|
|
||||||
drivers/accgyro_bma280.c \
|
|
||||||
drivers/accgyro_mma845x.c \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu3050.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/accgyro_l3g4200d.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/compass_ak8975.c \
|
|
||||||
drivers/sdcard.c \
|
|
||||||
drivers/sdcard_standard.c \
|
|
||||||
io/asyncfatfs/asyncfatfs.c \
|
|
||||||
io/asyncfatfs/fat_standard.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC)
|
|
||||||
|
|
||||||
CHEBUZZF3_SRC = \
|
|
||||||
$(STM32F3DISCOVERY_SRC) \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC)
|
|
||||||
|
|
||||||
COLIBRI_RACE_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
io/i2c_bst.c \
|
|
||||||
drivers/bus_bst_stm32f30x.c \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/accgyro_spi_mpu6000.c \
|
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/compass_ak8963.c \
|
|
||||||
drivers/compass_ak8975.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
KISSFC_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/display_ug2864hsweg01.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
io/flashfs.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
LUX_RACE_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
DOGE_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/barometer_spi_bmp280.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
SPARKY_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/compass_ak8975.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
ALIENFLIGHTF3_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
|
||||||
drivers/compass_ak8963.c \
|
|
||||||
hardware_revision.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
drivers/sonar_hcsr04.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
RMDO_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_softserial.c \
|
|
||||||
drivers/sonar_hcsr04.c \
|
|
||||||
io/flashfs.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC)
|
|
||||||
|
|
||||||
SPRACINGF3_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/barometer_bmp085.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/compass_ak8975.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_softserial.c \
|
|
||||||
drivers/sonar_hcsr04.c \
|
|
||||||
io/flashfs.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC)
|
|
||||||
|
|
||||||
IRCFUSIONF3_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/barometer_bmp085.c \
|
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
io/flashfs.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC)
|
|
||||||
|
|
||||||
SPRACINGF3EVO_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/compass_ak8963.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
drivers/sdcard.c \
|
|
||||||
drivers/sdcard_standard.c \
|
|
||||||
drivers/transponder_ir.c \
|
|
||||||
drivers/transponder_ir_stm32f30x.c \
|
|
||||||
io/asyncfatfs/asyncfatfs.c \
|
|
||||||
io/asyncfatfs/fat_standard.c \
|
|
||||||
io/transponder_ir.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
MOTOLAB_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/accgyro_spi_mpu6000.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_softserial.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
io/flashfs.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
SPRACINGF3MINI_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/compass_ak8975.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_softserial.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
drivers/sonar_hcsr04.c \
|
|
||||||
drivers/sdcard.c \
|
|
||||||
drivers/sdcard_standard.c \
|
|
||||||
drivers/transponder_ir.c \
|
|
||||||
drivers/transponder_ir_stm32f30x.c \
|
|
||||||
io/asyncfatfs/asyncfatfs.c \
|
|
||||||
io/asyncfatfs/fat_standard.c \
|
|
||||||
io/transponder_ir.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
# $(FATFS_SRC)
|
|
||||||
|
|
||||||
SINGULARITY_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/accgyro_mpu6050.c \
|
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_softserial.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
drivers/vtx_rtc6705.c \
|
|
||||||
io/flashfs.c \
|
|
||||||
io/vtx.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
FURYF3_SRC = \
|
|
||||||
$(STM32F30x_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/accgyro_spi_mpu6000.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
|
||||||
drivers/serial_usb_vcp.c \
|
|
||||||
drivers/sdcard.c \
|
|
||||||
drivers/sdcard_standard.c \
|
|
||||||
drivers/flash_m25p16.c \
|
|
||||||
drivers/sonar_hcsr04.c \
|
|
||||||
drivers/serial_softserial.c \
|
|
||||||
io/asyncfatfs/asyncfatfs.c \
|
|
||||||
io/asyncfatfs/fat_standard.c \
|
|
||||||
io/flashfs.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
ALIENFLIGHTF4_SRC = \
|
|
||||||
$(STM32F4xx_COMMON_SRC) \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
|
||||||
drivers/accgyro_spi_mpu9250.c \
|
|
||||||
drivers/barometer_bmp280.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/compass_ak8963.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
drivers/light_ws2811strip.c \
|
|
||||||
drivers/light_ws2811strip_stm32f4xx.c \
|
|
||||||
drivers/sdcard.c \
|
|
||||||
drivers/sdcard_standard.c \
|
|
||||||
io/asyncfatfs/asyncfatfs.c \
|
|
||||||
io/asyncfatfs/fat_standard.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
REVO_SRC = \
|
|
||||||
$(STM32F4xx_COMMON_SRC) \
|
|
||||||
drivers/accgyro_spi_mpu6000.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/compass_hmc5883l.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
FURYF4_SRC = \
|
|
||||||
$(STM32F4xx_COMMON_SRC) \
|
|
||||||
drivers/accgyro_spi_mpu6000.c \
|
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
|
||||||
drivers/accgyro_mpu6500.c \
|
|
||||||
drivers/barometer_ms5611.c \
|
|
||||||
drivers/sdcard.c \
|
|
||||||
drivers/sdcard_standard.c \
|
|
||||||
io/asyncfatfs/asyncfatfs.c \
|
|
||||||
io/asyncfatfs/fat_standard.c \
|
|
||||||
$(HIGHEND_SRC) \
|
|
||||||
$(COMMON_SRC) \
|
|
||||||
$(VCP_SRC)
|
|
||||||
|
|
||||||
# check if target.mk supplied
|
# check if target.mk supplied
|
||||||
ifneq ($(TARGET_SRC),)
|
ifneq ($(TARGET_SRC),)
|
||||||
|
@ -955,13 +503,21 @@ else ifeq ($(TARGET),$(filter $(TARGET),$(F1_TARGETS)))
|
||||||
TARGET_SRC := $(STM32F10x_COMMON_SRC) $(TARGET_SRC)
|
TARGET_SRC := $(STM32F10x_COMMON_SRC) $(TARGET_SRC)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(filter ONBOARDFLASH,$(FEATURES)),)
|
||||||
|
TARGET_SRC += \
|
||||||
|
drivers/flash_m25p16.c \
|
||||||
|
io/flashfs.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGET),$(filter $(TARGET),$(F4_TARGETS) $(F3_TARGETS)))
|
ifeq ($(TARGET),$(filter $(TARGET),$(F4_TARGETS) $(F3_TARGETS)))
|
||||||
TARGET_SRC += $(HIGHEND_SRC)
|
TARGET_SRC += $(HIGHEND_SRC)
|
||||||
|
else ifneq ($(filter HIGHEND,$(FEATURES)),)
|
||||||
|
TARGET_SRC += $(HIGHEND_SRC)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TARGET_SRC += $(COMMON_SRC)
|
TARGET_SRC += $(COMMON_SRC)
|
||||||
|
|
||||||
ifneq ($(filter SDCARD,$(OPTIONS)),)
|
ifneq ($(filter SDCARD,$(FEATURES)),)
|
||||||
TARGET_SRC += \
|
TARGET_SRC += \
|
||||||
drivers/sdcard.c \
|
drivers/sdcard.c \
|
||||||
drivers/sdcard_standard.c \
|
drivers/sdcard_standard.c \
|
||||||
|
@ -969,7 +525,7 @@ TARGET_SRC += \
|
||||||
io/asyncfatfs/fat_standard.c
|
io/asyncfatfs/fat_standard.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter VCP,$(OPTIONS)),)
|
ifneq ($(filter VCP,$(FEATURES)),)
|
||||||
TARGET_SRC += $(VCP_SRC)
|
TARGET_SRC += $(VCP_SRC)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -980,11 +536,10 @@ $(error Target source files not found. Have you prepared a target.mk?)
|
||||||
else
|
else
|
||||||
TARGET_SRC = $($(TARGET)_SRC)
|
TARGET_SRC = $($(TARGET)_SRC)
|
||||||
endif
|
endif
|
||||||
|
# end target specific make file checks
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Search path and source files for the ST stdperiph library
|
# Search path and source files for the ST stdperiph library
|
||||||
VPATH := $(VPATH):$(STDPERIPH_DIR)/src
|
VPATH := $(VPATH):$(STDPERIPH_DIR)/src
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,111 @@
|
||||||
|
/*
|
||||||
|
* This file is part of Cleanflight.
|
||||||
|
*
|
||||||
|
* Cleanflight is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Cleanflight is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
|
#include "build_config.h"
|
||||||
|
|
||||||
|
#include "drivers/system.h"
|
||||||
|
#include "drivers/bus_spi.h"
|
||||||
|
#include "drivers/sensor.h"
|
||||||
|
#include "drivers/exti.h"
|
||||||
|
#include "drivers/accgyro.h"
|
||||||
|
#include "drivers/accgyro_mpu.h"
|
||||||
|
#include "drivers/accgyro_mpu6500.h"
|
||||||
|
|
||||||
|
#include "hardware_revision.h"
|
||||||
|
|
||||||
|
static const char * const hardwareRevisionNames[] = {
|
||||||
|
"Unknown",
|
||||||
|
"Naze 32",
|
||||||
|
"Naze32 rev.5",
|
||||||
|
"Naze32 SP"
|
||||||
|
};
|
||||||
|
|
||||||
|
uint8_t hardwareRevision = UNKNOWN;
|
||||||
|
|
||||||
|
void detectHardwareRevision(void)
|
||||||
|
{
|
||||||
|
if (hse_value == 8000000)
|
||||||
|
hardwareRevision = NAZE32;
|
||||||
|
else if (hse_value == 12000000)
|
||||||
|
hardwareRevision = NAZE32_REV5;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef USE_SPI
|
||||||
|
|
||||||
|
#define DISABLE_SPI_CS IOLo(nazeSpiCsPin)
|
||||||
|
#define ENABLE_SPI_CS IOHi(nazeSpiCsPin)
|
||||||
|
|
||||||
|
#define SPI_DEVICE_NONE (0)
|
||||||
|
#define SPI_DEVICE_FLASH (1)
|
||||||
|
#define SPI_DEVICE_MPU (2)
|
||||||
|
|
||||||
|
#define M25P16_INSTRUCTION_RDID 0x9F
|
||||||
|
#define FLASH_M25P16_ID (0x202015)
|
||||||
|
|
||||||
|
static IO_t nazeSpiCsPin = IO_NONE;
|
||||||
|
|
||||||
|
uint8_t detectSpiDevice(void)
|
||||||
|
{
|
||||||
|
#ifdef NAZE_SPI_CS_PIN
|
||||||
|
nazeSpiCsPin = IOGetByTag(IO_TAG(NAZE_SPI_CS_PIN));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint8_t out[] = { M25P16_INSTRUCTION_RDID, 0, 0, 0 };
|
||||||
|
uint8_t in[4];
|
||||||
|
uint32_t flash_id;
|
||||||
|
|
||||||
|
// try autodetect flash chip
|
||||||
|
delay(50); // short delay required after initialisation of SPI device instance.
|
||||||
|
ENABLE_SPI_CS;
|
||||||
|
spiTransfer(NAZE_SPI_INSTANCE, in, out, sizeof(out));
|
||||||
|
DISABLE_SPI_CS;
|
||||||
|
|
||||||
|
flash_id = in[1] << 16 | in[2] << 8 | in[3];
|
||||||
|
if (flash_id == FLASH_M25P16_ID)
|
||||||
|
return SPI_DEVICE_FLASH;
|
||||||
|
|
||||||
|
|
||||||
|
// try autodetect MPU
|
||||||
|
delay(50);
|
||||||
|
ENABLE_SPI_CS;
|
||||||
|
spiTransferByte(NAZE_SPI_INSTANCE, MPU_RA_WHO_AM_I | MPU6500_BIT_RESET);
|
||||||
|
in[0] = spiTransferByte(NAZE_SPI_INSTANCE, 0xff);
|
||||||
|
DISABLE_SPI_CS;
|
||||||
|
|
||||||
|
if (in[0] == MPU6500_WHO_AM_I_CONST)
|
||||||
|
return SPI_DEVICE_MPU;
|
||||||
|
|
||||||
|
return SPI_DEVICE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void updateHardwareRevision(void)
|
||||||
|
{
|
||||||
|
#ifdef USE_SPI
|
||||||
|
uint8_t detectedSpiDevice = detectSpiDevice();
|
||||||
|
|
||||||
|
if (detectedSpiDevice == SPI_DEVICE_MPU && hardwareRevision == NAZE32_REV5)
|
||||||
|
hardwareRevision = NAZE32_SP;
|
||||||
|
#endif
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* This file is part of Cleanflight.
|
||||||
|
*
|
||||||
|
* Cleanflight is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Cleanflight is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef enum nazeHardwareRevision_t {
|
||||||
|
UNKNOWN = 0,
|
||||||
|
NAZE32, // Naze32 and compatible with 8MHz HSE
|
||||||
|
NAZE32_REV5, // Naze32 and compatible with 12MHz HSE
|
||||||
|
NAZE32_SP // Naze32 w/Sensor Platforms
|
||||||
|
} nazeHardwareRevision_e;
|
||||||
|
|
||||||
|
extern uint8_t hardwareRevision;
|
||||||
|
|
||||||
|
void updateHardwareRevision(void);
|
||||||
|
void detectHardwareRevision(void);
|
||||||
|
|
||||||
|
void spiBusInit(void);
|
|
@ -0,0 +1,90 @@
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <platform.h>
|
||||||
|
#include "drivers/pwm_mapping.h"
|
||||||
|
|
||||||
|
const uint16_t multiPPM[] = {
|
||||||
|
PWM1 | (MAP_TO_PPM_INPUT << 8), // PPM input
|
||||||
|
PWM9 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
|
||||||
|
PWM10 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
|
||||||
|
PWM11 | (MAP_TO_MOTOR_OUTPUT << 8),
|
||||||
|
PWM12 | (MAP_TO_MOTOR_OUTPUT << 8),
|
||||||
|
PWM13 | (MAP_TO_MOTOR_OUTPUT << 8),
|
||||||
|
PWM14 | (MAP_TO_MOTOR_OUTPUT << 8),
|
||||||
|
PWM5 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
|
||||||
|
PWM6 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
|
||||||
|
PWM7 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
|
||||||
|
PWM8 | (MAP_TO_MOTOR_OUTPUT << 8), // Swap to servo if needed
|
||||||
|
0xFFFF
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t multiPWM[] = {
|
||||||
|
PWM1 | (MAP_TO_PWM_INPUT << 8), // input #1
|
||||||
|
PWM2 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM3 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM4 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM5 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM6 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM7 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM8 | (MAP_TO_PWM_INPUT << 8), // input #8
|
||||||
|
PWM9 | (MAP_TO_MOTOR_OUTPUT << 8), // motor #1 or servo #1 (swap to servo if needed)
|
||||||
|
PWM10 | (MAP_TO_MOTOR_OUTPUT << 8), // motor #2 or servo #2 (swap to servo if needed)
|
||||||
|
PWM11 | (MAP_TO_MOTOR_OUTPUT << 8), // motor #1 or #3
|
||||||
|
PWM12 | (MAP_TO_MOTOR_OUTPUT << 8),
|
||||||
|
PWM13 | (MAP_TO_MOTOR_OUTPUT << 8),
|
||||||
|
PWM14 | (MAP_TO_MOTOR_OUTPUT << 8), // motor #4 or #6
|
||||||
|
0xFFFF
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t airPPM[] = {
|
||||||
|
PWM1 | (MAP_TO_PPM_INPUT << 8), // PPM input
|
||||||
|
PWM9 | (MAP_TO_MOTOR_OUTPUT << 8), // motor #1
|
||||||
|
PWM10 | (MAP_TO_MOTOR_OUTPUT << 8), // motor #2
|
||||||
|
PWM11 | (MAP_TO_SERVO_OUTPUT << 8), // servo #1
|
||||||
|
PWM12 | (MAP_TO_SERVO_OUTPUT << 8),
|
||||||
|
PWM13 | (MAP_TO_SERVO_OUTPUT << 8),
|
||||||
|
PWM14 | (MAP_TO_SERVO_OUTPUT << 8), // servo #4
|
||||||
|
PWM5 | (MAP_TO_SERVO_OUTPUT << 8), // servo #5
|
||||||
|
PWM6 | (MAP_TO_SERVO_OUTPUT << 8),
|
||||||
|
PWM7 | (MAP_TO_SERVO_OUTPUT << 8),
|
||||||
|
PWM8 | (MAP_TO_SERVO_OUTPUT << 8), // servo #8
|
||||||
|
0xFFFF
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t airPWM[] = {
|
||||||
|
PWM1 | (MAP_TO_PWM_INPUT << 8), // input #1
|
||||||
|
PWM2 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM3 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM4 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM5 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM6 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM7 | (MAP_TO_PWM_INPUT << 8),
|
||||||
|
PWM8 | (MAP_TO_PWM_INPUT << 8), // input #8
|
||||||
|
PWM9 | (MAP_TO_MOTOR_OUTPUT << 8), // motor #1
|
||||||
|
PWM10 | (MAP_TO_MOTOR_OUTPUT << 8), // motor #2
|
||||||
|
PWM11 | (MAP_TO_SERVO_OUTPUT << 8), // servo #1
|
||||||
|
PWM12 | (MAP_TO_SERVO_OUTPUT << 8),
|
||||||
|
PWM13 | (MAP_TO_SERVO_OUTPUT << 8),
|
||||||
|
PWM14 | (MAP_TO_SERVO_OUTPUT << 8), // servo #4
|
||||||
|
0xFFFF
|
||||||
|
};
|
||||||
|
|
||||||
|
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
|
||||||
|
{ TIM2, GPIOA, Pin_0, TIM_Channel_1, TIM2_IRQn, 0, Mode_IPD, 0}, // PWM1 - RC1
|
||||||
|
{ TIM2, GPIOA, Pin_1, TIM_Channel_2, TIM2_IRQn, 0, Mode_IPD, 0}, // PWM2 - RC2
|
||||||
|
{ TIM2, GPIOA, Pin_2, TIM_Channel_3, TIM2_IRQn, 0, Mode_IPD, 0}, // PWM3 - RC3
|
||||||
|
{ TIM2, GPIOA, Pin_3, TIM_Channel_4, TIM2_IRQn, 0, Mode_IPD, 0}, // PWM4 - RC4
|
||||||
|
{ TIM3, GPIOA, Pin_6, TIM_Channel_1, TIM3_IRQn, 0, Mode_IPD, 0}, // PWM5 - RC5
|
||||||
|
{ TIM3, GPIOA, Pin_7, TIM_Channel_2, TIM3_IRQn, 0, Mode_IPD, 0}, // PWM6 - RC6
|
||||||
|
{ TIM3, GPIOB, Pin_0, TIM_Channel_3, TIM3_IRQn, 0, Mode_IPD, 0}, // PWM7 - RC7
|
||||||
|
{ TIM3, GPIOB, Pin_1, TIM_Channel_4, TIM3_IRQn, 0, Mode_IPD, 0}, // PWM8 - RC8
|
||||||
|
{ TIM1, GPIOA, Pin_8, TIM_Channel_1, TIM1_CC_IRQn, 1, Mode_IPD, 0}, // PWM9 - OUT1
|
||||||
|
{ TIM1, GPIOA, Pin_11,TIM_Channel_4, TIM1_CC_IRQn, 1, Mode_IPD, 0}, // PWM10 - OUT2
|
||||||
|
{ TIM4, GPIOB, Pin_6, TIM_Channel_1, TIM4_IRQn, 0, Mode_IPD, 0}, // PWM11 - OUT3
|
||||||
|
{ TIM4, GPIOB, Pin_7, TIM_Channel_2, TIM4_IRQn, 0, Mode_IPD, 0}, // PWM12 - OUT4
|
||||||
|
{ TIM4, GPIOB, Pin_8, TIM_Channel_3, TIM4_IRQn, 0, Mode_IPD, 0}, // PWM13 - OUT5
|
||||||
|
{ TIM4, GPIOB, Pin_9, TIM_Channel_4, TIM4_IRQn, 0, Mode_IPD, 0} // PWM14 - OUT6
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,188 @@
|
||||||
|
/*
|
||||||
|
* This file is part of Cleanflight.
|
||||||
|
*
|
||||||
|
* Cleanflight is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Cleanflight is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define TARGET_BOARD_IDENTIFIER "AFF1" // AlienFlight F1.
|
||||||
|
#define ALIENFLIGHT
|
||||||
|
#define DEFAULT_FEATURES (FEATURE_RX_SERIAL | FEATURE_MOTOR_STOP)
|
||||||
|
#define USE_HARDWARE_REVISION_DETECTION
|
||||||
|
|
||||||
|
#define LED0 PB3 // PB3 (LED)
|
||||||
|
#define LED1 PB4 // PB4 (LED)
|
||||||
|
|
||||||
|
#define BEEPER PA12 // PA12 (Beeper)
|
||||||
|
|
||||||
|
#define BARO_XCLR_PIN PC13
|
||||||
|
#define BARO_EOC_PIN PC14
|
||||||
|
|
||||||
|
#define INVERTER PB2 // PB2 (BOOT1) abused as inverter select GPIO
|
||||||
|
#define INVERTER_USART USART2
|
||||||
|
|
||||||
|
#define USE_EXTI
|
||||||
|
|
||||||
|
// SPI2
|
||||||
|
// PB15 28 SPI2_MOSI
|
||||||
|
// PB14 27 SPI2_MISO
|
||||||
|
// PB13 26 SPI2_SCK
|
||||||
|
// PB12 25 SPI2_NSS
|
||||||
|
|
||||||
|
#define USE_SPI
|
||||||
|
#define USE_SPI_DEVICE_2
|
||||||
|
|
||||||
|
#define NAZE_SPI_INSTANCE SPI2
|
||||||
|
#define NAZE_SPI_CS_GPIO GPIOB
|
||||||
|
#define NAZE_SPI_CS_PIN PB12
|
||||||
|
#define NAZE_CS_GPIO_CLK_PERIPHERAL RCC_APB2Periph_GPIOB
|
||||||
|
|
||||||
|
// We either have this 16mbit flash chip on SPI or the MPU6500 acc/gyro depending on board revision:
|
||||||
|
#define M25P16_CS_GPIO NAZE_SPI_CS_GPIO
|
||||||
|
#define M25P16_CS_PIN NAZE_SPI_CS_PIN
|
||||||
|
#define M25P16_SPI_INSTANCE NAZE_SPI_INSTANCE
|
||||||
|
|
||||||
|
#define MPU6500_CS_GPIO_CLK_PERIPHERAL NAZE_CS_GPIO_CLK_PERIPHERAL
|
||||||
|
#define MPU6500_CS_GPIO NAZE_SPI_CS_GPIO
|
||||||
|
#define MPU6500_CS_PIN NAZE_SPI_CS_PIN
|
||||||
|
#define MPU6500_SPI_INSTANCE NAZE_SPI_INSTANCE
|
||||||
|
|
||||||
|
|
||||||
|
#define USE_FLASHFS
|
||||||
|
|
||||||
|
#define USE_FLASH_M25P16
|
||||||
|
|
||||||
|
#define EXTI_CALLBACK_HANDLER_COUNT 3 // MPU data ready, MAG data ready, BMP085 EOC
|
||||||
|
|
||||||
|
//#define DEBUG_MPU_DATA_READY_INTERRUPT
|
||||||
|
#define USE_MPU_DATA_READY_SIGNAL
|
||||||
|
|
||||||
|
//#define DEBUG_MAG_DATA_READY_INTERRUPT
|
||||||
|
#define USE_MAG_DATA_READY_SIGNAL
|
||||||
|
|
||||||
|
#define GYRO
|
||||||
|
#define USE_GYRO_MPU3050
|
||||||
|
#define USE_GYRO_MPU6050
|
||||||
|
#define USE_GYRO_MPU6500
|
||||||
|
#define USE_GYRO_SPI_MPU6500
|
||||||
|
|
||||||
|
|
||||||
|
#define GYRO_MPU3050_ALIGN CW0_DEG
|
||||||
|
#define GYRO_MPU6050_ALIGN CW0_DEG
|
||||||
|
#define GYRO_MPU6500_ALIGN CW0_DEG
|
||||||
|
|
||||||
|
#define ACC
|
||||||
|
#define USE_ACC_ADXL345
|
||||||
|
#define USE_ACC_BMA280
|
||||||
|
#define USE_ACC_MMA8452
|
||||||
|
#define USE_ACC_MPU6050
|
||||||
|
#define USE_ACC_MPU6500
|
||||||
|
#define USE_ACC_SPI_MPU6500
|
||||||
|
|
||||||
|
#define ACC_ADXL345_ALIGN CW270_DEG
|
||||||
|
#define ACC_MPU6050_ALIGN CW0_DEG
|
||||||
|
#define ACC_MMA8452_ALIGN CW90_DEG
|
||||||
|
#define ACC_BMA280_ALIGN CW0_DEG
|
||||||
|
#define ACC_MPU6500_ALIGN CW0_DEG
|
||||||
|
|
||||||
|
#define BARO
|
||||||
|
#define USE_BARO_MS5611
|
||||||
|
#define USE_BARO_BMP085
|
||||||
|
#define USE_BARO_BMP280
|
||||||
|
|
||||||
|
#define MAG
|
||||||
|
#define USE_MAG_HMC5883
|
||||||
|
|
||||||
|
#define MAG_HMC5883_ALIGN CW180_DEG
|
||||||
|
|
||||||
|
#define SONAR
|
||||||
|
#define DISPLAY
|
||||||
|
|
||||||
|
#define USE_USART1
|
||||||
|
#define USE_USART2
|
||||||
|
#define USE_USART3
|
||||||
|
#define USE_SOFTSERIAL1
|
||||||
|
#define USE_SOFTSERIAL2
|
||||||
|
#define SERIAL_PORT_COUNT 5
|
||||||
|
|
||||||
|
#define SOFTSERIAL_1_TIMER TIM3
|
||||||
|
#define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
|
||||||
|
#define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
|
||||||
|
#define SOFTSERIAL_2_TIMER TIM3
|
||||||
|
#define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7
|
||||||
|
#define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8
|
||||||
|
|
||||||
|
// USART3 only on NAZE32_SP - Flex Port
|
||||||
|
#define USART3_RX_PIN Pin_11
|
||||||
|
#define USART3_TX_PIN Pin_10
|
||||||
|
#define USART3_GPIO GPIOB
|
||||||
|
#define USART3_APB1_PERIPHERALS RCC_APB1Periph_USART3
|
||||||
|
#define USART3_APB2_PERIPHERALS RCC_APB2Periph_GPIOB
|
||||||
|
|
||||||
|
#define USE_I2C
|
||||||
|
#define I2C_DEVICE (I2CDEV_2)
|
||||||
|
|
||||||
|
// #define SOFT_I2C // enable to test software i2c
|
||||||
|
// #define SOFT_I2C_PB1011 // If SOFT_I2C is enabled above, need to define pinout as well (I2C1 = PB67, I2C2 = PB1011)
|
||||||
|
// #define SOFT_I2C_PB67
|
||||||
|
|
||||||
|
#define USE_ADC
|
||||||
|
|
||||||
|
#define CURRENT_METER_ADC_GPIO GPIOB
|
||||||
|
#define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
|
||||||
|
#define CURRENT_METER_ADC_CHANNEL ADC_Channel_9
|
||||||
|
|
||||||
|
#define VBAT_ADC_GPIO GPIOA
|
||||||
|
#define VBAT_ADC_GPIO_PIN GPIO_Pin_4
|
||||||
|
#define VBAT_ADC_CHANNEL ADC_Channel_4
|
||||||
|
|
||||||
|
#define RSSI_ADC_GPIO GPIOA
|
||||||
|
#define RSSI_ADC_GPIO_PIN GPIO_Pin_1
|
||||||
|
#define RSSI_ADC_CHANNEL ADC_Channel_1
|
||||||
|
|
||||||
|
#define EXTERNAL1_ADC_GPIO GPIOA
|
||||||
|
#define EXTERNAL1_ADC_GPIO_PIN GPIO_Pin_5
|
||||||
|
#define EXTERNAL1_ADC_CHANNEL ADC_Channel_5
|
||||||
|
|
||||||
|
|
||||||
|
#define LED_STRIP
|
||||||
|
#define LED_STRIP_TIMER TIM3
|
||||||
|
#define WS2811_DMA_TC_FLAG DMA1_FLAG_TC6
|
||||||
|
#define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH6_HANDLER
|
||||||
|
|
||||||
|
#undef GPS
|
||||||
|
|
||||||
|
#define SPEKTRUM_BIND
|
||||||
|
// USART2, PA3
|
||||||
|
#define BIND_PIN PA3
|
||||||
|
#define BINDPLUG_PIN PB5
|
||||||
|
|
||||||
|
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
||||||
|
|
||||||
|
// alternative defaults for AlienFlight F1 target
|
||||||
|
|
||||||
|
#define HARDWARE_BIND_PLUG
|
||||||
|
|
||||||
|
// IO - assuming all IOs on 48pin package
|
||||||
|
#define TARGET_IO_PORTA 0xffff
|
||||||
|
#define TARGET_IO_PORTB 0xffff
|
||||||
|
#define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
|
||||||
|
|
||||||
|
|
||||||
|
#define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4))
|
||||||
|
|
||||||
|
#define TIMER_APB1_PERIPHERALS (RCC_APB1Periph_TIM2 | RCC_APB1Periph_TIM3 | RCC_APB1Periph_TIM4)
|
||||||
|
#define TIMER_APB2_PERIPHERALS (RCC_APB2Periph_TIM1 | RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB)
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
FEATURES = ONBOARDFLASH HIGHEND
|
||||||
|
F1_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_adxl345.c \
|
||||||
|
drivers/accgyro_bma280.c \
|
||||||
|
drivers/accgyro_l3g4200d.c \
|
||||||
|
drivers/accgyro_mma845x.c \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu3050.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/barometer_bmp085.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f10x.c \
|
||||||
|
drivers/sonar_hcsr04.c \
|
||||||
|
hardware_revision.c
|
|
@ -0,0 +1,12 @@
|
||||||
|
FEATURES = VCP
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/compass_ak8963.c \
|
||||||
|
hardware_revision.c \
|
||||||
|
drivers/sonar_hcsr04.c
|
|
@ -0,0 +1,13 @@
|
||||||
|
F405_TARGETS += $(TARGET)
|
||||||
|
FEATURES += SDCARD VCP
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/accgyro_spi_mpu9250.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/compass_ak8963.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f4xx.c
|
|
@ -1,5 +1,5 @@
|
||||||
F405_TARGETS += $(TARGET)
|
F405_TARGETS += $(TARGET)
|
||||||
OPTIONS += SDCARD VCP
|
FEATURES += SDCARD VCP
|
||||||
|
|
||||||
TARGET_SRC = \
|
TARGET_SRC = \
|
||||||
drivers/accgyro_spi_mpu6500.c \
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
FEATURES = ONBOARDFLASH HIGHEND
|
||||||
|
F1_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_spi_mpu6000.c \
|
||||||
|
drivers/barometer_bmp085.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f10x.c \
|
||||||
|
drivers/sonar_hcsr04.c
|
|
@ -14,13 +14,16 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define TARGET_BOARD_IDENTIFIER "CHF3" // Chebuzz F3
|
#define TARGET_BOARD_IDENTIFIER "CHF3" // Chebuzz F3
|
||||||
|
|
||||||
#define CONFIG_FASTLOOP_PREFERRED_ACC ACC_NONE
|
#define CONFIG_FASTLOOP_PREFERRED_ACC ACC_NONE
|
||||||
|
|
||||||
|
#ifndef STM32F3DISCOVERY
|
||||||
|
#define STM32F3DISCOVERY
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LED0 PE8 // Blue LEDs - PE8/PE12
|
#define LED0 PE8 // Blue LEDs - PE8/PE12
|
||||||
#define LED0_INVERTED
|
#define LED0_INVERTED
|
||||||
#define LED1 PE10 // Orange LEDs - PE10/PE14
|
#define LED1 PE10 // Orange LEDs - PE10/PE14
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
FEATURES = VCP SDCARD
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/accgyro_l3gd20.c \
|
||||||
|
drivers/accgyro_lsm303dlhc.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/accgyro_adxl345.c \
|
||||||
|
drivers/accgyro_bma280.c \
|
||||||
|
drivers/accgyro_mma845x.c \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu3050.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/accgyro_l3g4200d.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/compass_ak8975.c
|
|
@ -52,12 +52,12 @@
|
||||||
#define BIND_PIN PA3
|
#define BIND_PIN PA3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if (FLASH_SIZE > 64)
|
#if (FLASH_SIZE > 64)
|
||||||
#define BLACKBOX
|
#define BLACKBOX
|
||||||
#define USE_SERVOS
|
#define USE_SERVOS
|
||||||
#else
|
#else
|
||||||
// Since the CJMCU PCB has holes for 4 motors in each corner we can save same flash space by disabling support for other mixers.
|
// Since the CJMCU PCB has holes for 4 motors in each corner we can save same flash space by disabling support for other mixers.
|
||||||
|
#undef USE_CLI
|
||||||
#define USE_QUAD_MIXER_ONLY
|
#define USE_QUAD_MIXER_ONLY
|
||||||
#define SKIP_TASK_STATISTICS
|
#define SKIP_TASK_STATISTICS
|
||||||
#define SKIP_CLI_COMMAND_HELP
|
#define SKIP_CLI_COMMAND_HELP
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
FLASH_SIZE = 64
|
||||||
|
F1_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
hardware_revision.c \
|
||||||
|
flight/gtune.c \
|
||||||
|
blackbox/blackbox.c \
|
||||||
|
blackbox/blackbox_io.c
|
|
@ -0,0 +1,17 @@
|
||||||
|
FEATURES = VCP
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
io/i2c_bst.c \
|
||||||
|
drivers/bus_bst_stm32f30x.c \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/accgyro_spi_mpu6000.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/compass_ak8963.c \
|
||||||
|
drivers/compass_ak8975.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c
|
|
@ -0,0 +1,15 @@
|
||||||
|
FEATURES = VCP
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/barometer_spi_bmp280.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
FEATURES = ONBOARDFLASH HIGHEND
|
||||||
|
F1_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
DEVICE_FLAGS = -DSTM32F10X_HD
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_adxl345.c \
|
||||||
|
drivers/accgyro_bma280.c \
|
||||||
|
drivers/accgyro_l3g4200d.c \
|
||||||
|
drivers/accgyro_mma845x.c \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu3050.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/accgyro_spi_mpu6000.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/barometer_bmp085.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/compass_ak8975.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f10x.c \
|
||||||
|
drivers/sonar_hcsr04.c
|
|
@ -0,0 +1,15 @@
|
||||||
|
FEATURES = VCP SDCARD ONBOARDFLASH
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/accgyro_spi_mpu6000.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c \
|
||||||
|
drivers/sonar_hcsr04.c \
|
||||||
|
drivers/serial_softserial.c
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
F405_TARGETS += $(TARGET)
|
||||||
|
FEATURES += SDCARD VCP
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_spi_mpu6000.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/barometer_ms5611.c
|
|
@ -0,0 +1,8 @@
|
||||||
|
FEATURES = VCP ONBOARDFLASH
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
TARGET_FLAGS = -DSPRACINGF3
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/barometer_bmp085.c
|
|
@ -0,0 +1,10 @@
|
||||||
|
FEATURES = VCP
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/display_ug2864hsweg01.c \
|
||||||
|
drivers/accgyro_mpu6050.c
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
FEATURES = VCP
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
FEATURES = VCP ONBOARDFLASH
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/accgyro_spi_mpu6000.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c \
|
||||||
|
drivers/serial_softserial.c
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
FEATURES = ONBOARDFLASH HIGHEND
|
||||||
|
F1_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_adxl345.c \
|
||||||
|
drivers/accgyro_bma280.c \
|
||||||
|
drivers/accgyro_l3g4200d.c \
|
||||||
|
drivers/accgyro_mma845x.c \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu3050.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/barometer_bmp085.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f10x.c \
|
||||||
|
drivers/sonar_hcsr04.c \
|
||||||
|
hardware_revision.c
|
|
@ -0,0 +1,4 @@
|
||||||
|
FEATURES = VCP
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC =
|
|
@ -0,0 +1,12 @@
|
||||||
|
FEATURES = HIGHEND
|
||||||
|
F1_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/barometer_bmp085.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f10x.c \
|
||||||
|
drivers/sonar_hcsr04.c
|
|
@ -0,0 +1,23 @@
|
||||||
|
FEATURES = ONBOARDFLASH HIGHEND
|
||||||
|
F1_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
DEVICE_FLAGS = -DSTM32F10X_HD
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_adxl345.c \
|
||||||
|
drivers/accgyro_bma280.c \
|
||||||
|
drivers/accgyro_l3g4200d.c \
|
||||||
|
drivers/accgyro_mma845x.c \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu3050.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/accgyro_spi_mpu6000.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/barometer_bmp085.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/compass_ak8975.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f10x.c \
|
||||||
|
drivers/sonar_hcsr04.c
|
|
@ -0,0 +1,8 @@
|
||||||
|
F405_TARGETS += $(TARGET)
|
||||||
|
FEATURES += VCP ONBOARDFLASH
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_spi_mpu6000.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/compass_hmc5883l.c
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
FEATURES = VCP ONBOARDFLASH
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
TARGET_FLAGS = -DSPRACINGF3
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c \
|
||||||
|
drivers/serial_softserial.c \
|
||||||
|
drivers/sonar_hcsr04.c
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
FEATURES = VCP ONBOARDFLASH
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c \
|
||||||
|
drivers/serial_softserial.c \
|
||||||
|
drivers/vtx_rtc6705.c
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
FEATURES = VCP
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/compass_ak8975.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
FEATURES = VCP ONBOARDFLASH
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/barometer_bmp085.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/compass_ak8975.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c \
|
||||||
|
drivers/serial_softserial.c \
|
||||||
|
drivers/sonar_hcsr04.c
|
|
@ -0,0 +1,16 @@
|
||||||
|
FEATURES = VCP SDCARD
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/compass_ak8963.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c \
|
||||||
|
drivers/serial_usb_vcp.c \
|
||||||
|
drivers/transponder_ir.c \
|
||||||
|
drivers/transponder_ir_stm32f30x.c \
|
||||||
|
io/transponder_ir.c
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
FEATURES = VCP SDCARD
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/compass_ak8975.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/flash_m25p16.c \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/light_ws2811strip_stm32f30x.c \
|
||||||
|
drivers/serial_softserial.c \
|
||||||
|
drivers/serial_usb_vcp.c \
|
||||||
|
drivers/sonar_hcsr04.c \
|
||||||
|
drivers/transponder_ir.c \
|
||||||
|
drivers/transponder_ir_stm32f30x.c \
|
||||||
|
io/transponder_ir.c
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
FEATURES = VCP SDCARD
|
||||||
|
F3_TARGETS += $(TARGET)
|
||||||
|
|
||||||
|
TARGET_SRC = \
|
||||||
|
drivers/light_ws2811strip.c \
|
||||||
|
drivers/accgyro_l3gd20.c \
|
||||||
|
drivers/accgyro_lsm303dlhc.c \
|
||||||
|
drivers/compass_hmc5883l.c \
|
||||||
|
drivers/accgyro_adxl345.c \
|
||||||
|
drivers/accgyro_bma280.c \
|
||||||
|
drivers/accgyro_mma845x.c \
|
||||||
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu3050.c \
|
||||||
|
drivers/accgyro_mpu6050.c \
|
||||||
|
drivers/accgyro_l3g4200d.c \
|
||||||
|
drivers/barometer_ms5611.c \
|
||||||
|
drivers/barometer_bmp280.c \
|
||||||
|
drivers/compass_ak8975.c
|
Loading…
Reference in New Issue