diff --git a/src/main/target/STM32F405/target.h b/src/main/target/STM32F405/target.h deleted file mode 100644 index 97641ea088..0000000000 --- a/src/main/target/STM32F405/target.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file is part of Cleanflight and Betaflight. - * - * Cleanflight and Betaflight are free software. You can redistribute - * this software and/or modify this software 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 and Betaflight are distributed in the hope that they - * 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 this software. - * - * If not, see . - */ - -#pragma once - -#include "target/common_unified.h" - -#define TARGET_BOARD_IDENTIFIER "S405" - -#define USBD_PRODUCT_STRING "Betaflight STM32F405" - -#define USE_I2C_DEVICE_1 -#define USE_I2C_DEVICE_2 -#define USE_I2C_DEVICE_3 - -#define USE_UART1 -#define USE_UART2 -#define USE_UART3 -#define USE_UART4 -#define USE_UART5 -#define USE_UART6 - -#define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 6) - -#define USE_INVERTER - -#define USE_SPI_DEVICE_1 -#define USE_SPI_DEVICE_2 -#define USE_SPI_DEVICE_3 - -#define TARGET_IO_PORTA 0xffff -#define TARGET_IO_PORTB 0xffff -#define TARGET_IO_PORTC 0xffff -#define TARGET_IO_PORTD 0xffff -#define TARGET_IO_PORTE 0xffff -#define TARGET_IO_PORTF 0xffff diff --git a/src/main/target/STM32F411/target.c b/src/main/target/STM32F411/target.c deleted file mode 100644 index a087e06bd2..0000000000 --- a/src/main/target/STM32F411/target.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is part of Cleanflight and Betaflight. - * - * Cleanflight and Betaflight are free software. You can redistribute - * this software and/or modify this software 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 and Betaflight are distributed in the hope that they - * 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 this software. - * - * If not, see . - */ - -// Needed to suppress the pedantic warning about an empty file -#include diff --git a/src/main/target/STM32F411/target.h b/src/main/target/STM32F411/target.h deleted file mode 100644 index f4932fa4b2..0000000000 --- a/src/main/target/STM32F411/target.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This file is part of Cleanflight and Betaflight. - * - * Cleanflight and Betaflight are free software. You can redistribute - * this software and/or modify this software 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 and Betaflight are distributed in the hope that they - * 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 this software. - * - * If not, see . - */ - -#pragma once - -#include "target/common_unified.h" - -#define TARGET_BOARD_IDENTIFIER "S411" - -#define USBD_PRODUCT_STRING "Betaflight STM32F411" - -#define USE_I2C_DEVICE_1 -#define USE_I2C_DEVICE_2 -#define USE_I2C_DEVICE_3 - -#define USE_UART1 -#define USE_UART2 -#define USE_UART6 - -#define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 3) - -#define USE_INVERTER - -#define USE_SPI_DEVICE_1 -#define USE_SPI_DEVICE_2 -#define USE_SPI_DEVICE_3 - -#define TARGET_IO_PORTA 0xffff -#define TARGET_IO_PORTB 0xffff -#define TARGET_IO_PORTC 0xffff -#define TARGET_IO_PORTD 0xffff -#define TARGET_IO_PORTE 0xffff diff --git a/src/main/target/STM32F411/target.mk b/src/main/target/STM32F411/target.mk deleted file mode 100644 index 01341a0e2b..0000000000 --- a/src/main/target/STM32F411/target.mk +++ /dev/null @@ -1,21 +0,0 @@ -F411_TARGETS += $(TARGET) - -FEATURES += VCP SDCARD_SPI SDCARD_SDIO ONBOARDFLASH - -TARGET_SRC = \ - $(addprefix drivers/accgyro/,$(notdir $(wildcard $(SRC_DIR)/drivers/accgyro/*.c))) \ - $(addprefix drivers/barometer/,$(notdir $(wildcard $(SRC_DIR)/drivers/barometer/*.c))) \ - $(addprefix drivers/compass/,$(notdir $(wildcard $(SRC_DIR)/drivers/compass/*.c))) \ - drivers/max7456.c \ - drivers/vtx_rtc6705.c \ - drivers/vtx_rtc6705_soft_spi.c \ - rx/cc2500_common.c \ - rx/cc2500_frsky_shared.c \ - rx/cc2500_frsky_d.c \ - rx/cc2500_frsky_x.c \ - rx/cc2500_sfhss.c \ - rx/a7105_flysky.c \ - rx/cyrf6936_spektrum.c \ - drivers/rx/rx_cc2500.c \ - drivers/rx/rx_a7105.c \ - drivers/rx/rx_cyrf6936.c diff --git a/src/main/target/STM32F745/target.c b/src/main/target/STM32F745/target.c deleted file mode 100644 index a087e06bd2..0000000000 --- a/src/main/target/STM32F745/target.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is part of Cleanflight and Betaflight. - * - * Cleanflight and Betaflight are free software. You can redistribute - * this software and/or modify this software 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 and Betaflight are distributed in the hope that they - * 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 this software. - * - * If not, see . - */ - -// Needed to suppress the pedantic warning about an empty file -#include diff --git a/src/main/target/STM32F7X2/target.c b/src/main/target/STM32F7X2/target.c deleted file mode 100644 index a087e06bd2..0000000000 --- a/src/main/target/STM32F7X2/target.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is part of Cleanflight and Betaflight. - * - * Cleanflight and Betaflight are free software. You can redistribute - * this software and/or modify this software 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 and Betaflight are distributed in the hope that they - * 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 this software. - * - * If not, see . - */ - -// Needed to suppress the pedantic warning about an empty file -#include diff --git a/src/main/target/STM32F7X2/target.h b/src/main/target/STM32F7X2/target.h deleted file mode 100644 index f91d76ba46..0000000000 --- a/src/main/target/STM32F7X2/target.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of Cleanflight and Betaflight. - * - * Cleanflight and Betaflight are free software. You can redistribute - * this software and/or modify this software 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 and Betaflight are distributed in the hope that they - * 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 this software. - * - * If not, see . - */ - -#pragma once - -#include "target/common_unified.h" - -#define TARGET_BOARD_IDENTIFIER "S7X2" - -#define USBD_PRODUCT_STRING "Betaflight STM32F7x2" - -#define USE_I2C_DEVICE_1 -#define USE_I2C_DEVICE_2 -#define USE_I2C_DEVICE_3 - -#define USE_UART1 -#define USE_UART2 -#define USE_UART3 -#define USE_UART4 -#define USE_UART5 -#define USE_UART6 - -#define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 6) - -#define USE_SPI_DEVICE_1 -#define USE_SPI_DEVICE_2 -#define USE_SPI_DEVICE_3 - -#define TARGET_IO_PORTA 0xffff -#define TARGET_IO_PORTB 0xffff -#define TARGET_IO_PORTC 0xffff -#define TARGET_IO_PORTD 0xffff -#define TARGET_IO_PORTE 0xffff -#define TARGET_IO_PORTF 0xffff diff --git a/src/main/target/STM32F7X2/target.mk b/src/main/target/STM32F7X2/target.mk deleted file mode 100644 index fbf7655b77..0000000000 --- a/src/main/target/STM32F7X2/target.mk +++ /dev/null @@ -1,21 +0,0 @@ -F7X2RE_TARGETS += $(TARGET) - -FEATURES += VCP SDCARD_SPI SDCARD_SDIO ONBOARDFLASH - -TARGET_SRC = \ - $(addprefix drivers/accgyro/,$(notdir $(wildcard $(SRC_DIR)/drivers/accgyro/*.c))) \ - $(addprefix drivers/barometer/,$(notdir $(wildcard $(SRC_DIR)/drivers/barometer/*.c))) \ - $(addprefix drivers/compass/,$(notdir $(wildcard $(SRC_DIR)/drivers/compass/*.c))) \ - drivers/max7456.c \ - drivers/vtx_rtc6705.c \ - drivers/vtx_rtc6705_soft_spi.c \ - rx/cc2500_common.c \ - rx/cc2500_frsky_shared.c \ - rx/cc2500_frsky_d.c \ - rx/cc2500_frsky_x.c \ - rx/cc2500_sfhss.c \ - rx/a7105_flysky.c \ - rx/cyrf6936_spektrum.c \ - drivers/rx/rx_cc2500.c \ - drivers/rx/rx_a7105.c \ - drivers/rx/rx_cyrf6936.c diff --git a/src/main/target/STM32_UNIFIED/STM32F405.mk b/src/main/target/STM32_UNIFIED/STM32F405.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/main/target/STM32_UNIFIED/STM32F411.mk b/src/main/target/STM32_UNIFIED/STM32F411.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/main/target/STM32_UNIFIED/STM32F745.mk b/src/main/target/STM32_UNIFIED/STM32F745.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/main/target/STM32_UNIFIED/STM32F7X2.mk b/src/main/target/STM32_UNIFIED/STM32F7X2.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/main/target/STM32_UNIFIED/STM32_UNIFIED.nomk b/src/main/target/STM32_UNIFIED/STM32_UNIFIED.nomk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/main/target/STM32F405/target.c b/src/main/target/STM32_UNIFIED/target.c similarity index 100% rename from src/main/target/STM32F405/target.c rename to src/main/target/STM32_UNIFIED/target.c diff --git a/src/main/target/common_unified.h b/src/main/target/STM32_UNIFIED/target.h similarity index 54% rename from src/main/target/common_unified.h rename to src/main/target/STM32_UNIFIED/target.h index f6bf25d720..562538aa80 100644 --- a/src/main/target/common_unified.h +++ b/src/main/target/STM32_UNIFIED/target.h @@ -20,6 +20,127 @@ #pragma once +#if defined(STM32F405) +#define TARGET_BOARD_IDENTIFIER "S405" + +#define USBD_PRODUCT_STRING "Betaflight STM32F405" + +#define USE_I2C_DEVICE_1 +#define USE_I2C_DEVICE_2 +#define USE_I2C_DEVICE_3 + +#define USE_UART1 +#define USE_UART2 +#define USE_UART3 +#define USE_UART4 +#define USE_UART5 +#define USE_UART6 + +#define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 6) + +#define USE_INVERTER + +#define USE_SPI_DEVICE_1 +#define USE_SPI_DEVICE_2 +#define USE_SPI_DEVICE_3 + +#define TARGET_IO_PORTA 0xffff +#define TARGET_IO_PORTB 0xffff +#define TARGET_IO_PORTC 0xffff +#define TARGET_IO_PORTD 0xffff +#define TARGET_IO_PORTE 0xffff +#define TARGET_IO_PORTF 0xffff + +#elif defined(STM32F411) +#define TARGET_BOARD_IDENTIFIER "S411" + +#define USBD_PRODUCT_STRING "Betaflight STM32F411" + +#define USE_I2C_DEVICE_1 +#define USE_I2C_DEVICE_2 +#define USE_I2C_DEVICE_3 + +#define USE_UART1 +#define USE_UART2 +#define USE_UART6 + +#define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 3) + +#define USE_INVERTER + +#define USE_SPI_DEVICE_1 +#define USE_SPI_DEVICE_2 +#define USE_SPI_DEVICE_3 + +#define TARGET_IO_PORTA 0xffff +#define TARGET_IO_PORTB 0xffff +#define TARGET_IO_PORTC 0xffff +#define TARGET_IO_PORTD 0xffff +#define TARGET_IO_PORTE 0xffff + +#elif defined(STM32F7X2) +#define TARGET_BOARD_IDENTIFIER "S7X2" + +#define USBD_PRODUCT_STRING "Betaflight STM32F7x2" + +#define USE_I2C_DEVICE_1 +#define USE_I2C_DEVICE_2 +#define USE_I2C_DEVICE_3 + +#define USE_UART1 +#define USE_UART2 +#define USE_UART3 +#define USE_UART4 +#define USE_UART5 +#define USE_UART6 + +#define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 6) + +#define USE_SPI_DEVICE_1 +#define USE_SPI_DEVICE_2 +#define USE_SPI_DEVICE_3 + +#define TARGET_IO_PORTA 0xffff +#define TARGET_IO_PORTB 0xffff +#define TARGET_IO_PORTC 0xffff +#define TARGET_IO_PORTD 0xffff +#define TARGET_IO_PORTE 0xffff +#define TARGET_IO_PORTF 0xffff + +#elif defined(STM32F745) +#define TARGET_BOARD_IDENTIFIER "S745" + +#define USBD_PRODUCT_STRING "Betaflight STM32F745" + +#define USE_I2C_DEVICE_1 +#define USE_I2C_DEVICE_2 +#define USE_I2C_DEVICE_3 +#define USE_I2C_DEVICE_4 + +#define USE_UART1 +#define USE_UART2 +#define USE_UART3 +#define USE_UART4 +#define USE_UART5 +#define USE_UART6 +#define USE_UART7 +#define USE_UART8 + +#define SERIAL_PORT_COUNT (UNIFIED_SERIAL_PORT_COUNT + 8) + +#define USE_SPI_DEVICE_1 +#define USE_SPI_DEVICE_2 +#define USE_SPI_DEVICE_3 +#define USE_SPI_DEVICE_4 + +#define TARGET_IO_PORTA 0xffff +#define TARGET_IO_PORTB 0xffff +#define TARGET_IO_PORTC 0xffff +#define TARGET_IO_PORTD 0xffff +#define TARGET_IO_PORTE 0xffff +#define TARGET_IO_PORTF 0xffff +#endif + // Treat the target as unified, and expect manufacturer id / board name // to be supplied when the board is configured for the first time #define USE_UNIFIED_TARGET @@ -44,10 +165,10 @@ #define USE_GYRO_SPI_MPU6500 #define USE_ACC_SPI_ICM20689 #define USE_GYRO_SPI_ICM20689 + #if (TARGET_FLASH_SIZE > 512) #define USE_ACCGYRO_BMI270 #endif -// Other USE_ACCs and USE_GYROs should follow #define USE_MAG #define USE_MAG_DATA_READY_SIGNAL diff --git a/src/main/target/STM32F405/target.mk b/src/main/target/STM32_UNIFIED/target.mk similarity index 81% rename from src/main/target/STM32F405/target.mk rename to src/main/target/STM32_UNIFIED/target.mk index 084084b485..d8236b4730 100644 --- a/src/main/target/STM32F405/target.mk +++ b/src/main/target/STM32_UNIFIED/target.mk @@ -1,11 +1,26 @@ +ifeq ($(TARGET), STM32F405) F405_TARGETS += $(TARGET) -FEATURES += VCP SDCARD_SPI SDCARD_SDIO ONBOARDFLASH - # Use a full block (16 kB) of flash for custom defaults - with 1 MB flash we have more than we know how to use anyway CUSTOM_DEFAULTS_EXTENDED = yes +else +ifeq ($(TARGET), STM32F411) +F411_TARGETS += $(TARGET) + +else +ifeq ($(TARGET), STM32F7X2) +F7X2RE_TARGETS += $(TARGET) + +else +F7X5XG_TARGETS += $(TARGET) +endif +endif +endif + +FEATURES += VCP SDCARD_SPI SDCARD_SDIO ONBOARDFLASH + TARGET_SRC = \ $(addprefix drivers/accgyro/,$(notdir $(wildcard $(SRC_DIR)/drivers/accgyro/*.c))) \ $(addprefix drivers/barometer/,$(notdir $(wildcard $(SRC_DIR)/drivers/barometer/*.c))) \