From 357e9b0e3ca63f35baf055a95045408e656b38f7 Mon Sep 17 00:00:00 2001 From: "Pawel Spychalski (DzikuVx)" Date: Sat, 5 Aug 2023 16:52:27 +0200 Subject: [PATCH 1/3] SpeedyBee F7 Mini 2 --- src/main/target/SPEEDYBEEF7MINI/CMakeLists.txt | 1 + src/main/target/SPEEDYBEEF7MINI/target.h | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/main/target/SPEEDYBEEF7MINI/CMakeLists.txt b/src/main/target/SPEEDYBEEF7MINI/CMakeLists.txt index c7a92612742..d1b5f7e91f8 100644 --- a/src/main/target/SPEEDYBEEF7MINI/CMakeLists.txt +++ b/src/main/target/SPEEDYBEEF7MINI/CMakeLists.txt @@ -1 +1,2 @@ target_stm32f722xe(SPEEDYBEEF7MINI) +target_stm32f722xe(SPEEDYBEEF7MINI2) diff --git a/src/main/target/SPEEDYBEEF7MINI/target.h b/src/main/target/SPEEDYBEEF7MINI/target.h index f6db8e86fa4..e95101469cf 100644 --- a/src/main/target/SPEEDYBEEF7MINI/target.h +++ b/src/main/target/SPEEDYBEEF7MINI/target.h @@ -40,6 +40,15 @@ #define MPU6000_CS_PIN PB2 #define MPU6000_SPI_BUS BUS_SPI1 +#ifdef SPEEDYBEEF7MINI2 + +#define USE_IMU_BMI270 +#define IMU_BMI270_ALIGN CW0_DEG +#define BMI270_CS_PIN PB2 +#define BMI270_SPI_BUS BUS_SPI1 + +#endif + // *************** I2C /Baro/Mag ********************* #define USE_I2C #define USE_I2C_DEVICE_1 From bd454fb8544ed636b3f3a5bcda989746d1b2abc0 Mon Sep 17 00:00:00 2001 From: "Pawel Spychalski (DzikuVx)" Date: Fri, 18 Aug 2023 13:02:39 +0200 Subject: [PATCH 2/3] BMI270 update --- src/main/target/SPEEDYBEEF7MINI/target.c | 4 ++++ src/main/target/SPEEDYBEEF7MINI/target.h | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/target/SPEEDYBEEF7MINI/target.c b/src/main/target/SPEEDYBEEF7MINI/target.c index 468ac3c2f62..a7da42c07e2 100644 --- a/src/main/target/SPEEDYBEEF7MINI/target.c +++ b/src/main/target/SPEEDYBEEF7MINI/target.c @@ -26,7 +26,11 @@ #include "drivers/pinio.h" #include "drivers/sensor.h" +#ifdef SPEEDYBEEF7MINI2 +BUSDEV_REGISTER_SPI_TAG(busdev_bmi270, DEVHW_BMI270, BMI270_SPI_BUS, BMI270_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_BMI270_ALIGN); +#else BUSDEV_REGISTER_SPI_TAG(busdev_mpu6000, DEVHW_MPU6000, MPU6000_SPI_BUS, MPU6000_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_MPU6000_ALIGN); +#endif timerHardware_t timerHardware[] = { DEF_TIM(TIM3, CH1, PB4, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0), // S1 UP1-2 D(1, 4, 5) diff --git a/src/main/target/SPEEDYBEEF7MINI/target.h b/src/main/target/SPEEDYBEEF7MINI/target.h index e95101469cf..8b2e469ceb5 100644 --- a/src/main/target/SPEEDYBEEF7MINI/target.h +++ b/src/main/target/SPEEDYBEEF7MINI/target.h @@ -19,7 +19,12 @@ #pragma once #define TARGET_BOARD_IDENTIFIER "SBMN" + +#ifdef SPEEDYBEEF7MINI2 +#define USBD_PRODUCT_STRING "SPEEDYBEEF7MINI2" +#else #define USBD_PRODUCT_STRING "SPEEDYBEEF7MINI" +#endif #define LED0 PA14 //Blue SWCLK @@ -35,11 +40,6 @@ #define SPI1_MISO_PIN PA6 #define SPI1_MOSI_PIN PA7 -#define USE_IMU_MPU6000 -#define IMU_MPU6000_ALIGN CW0_DEG -#define MPU6000_CS_PIN PB2 -#define MPU6000_SPI_BUS BUS_SPI1 - #ifdef SPEEDYBEEF7MINI2 #define USE_IMU_BMI270 @@ -47,6 +47,13 @@ #define BMI270_CS_PIN PB2 #define BMI270_SPI_BUS BUS_SPI1 +#else + +#define USE_IMU_MPU6000 +#define IMU_MPU6000_ALIGN CW0_DEG +#define MPU6000_CS_PIN PB2 +#define MPU6000_SPI_BUS BUS_SPI1 + #endif // *************** I2C /Baro/Mag ********************* From d0a4bd2fcda79f1825cab1472cf64c2b6da8bc68 Mon Sep 17 00:00:00 2001 From: "Pawel Spychalski (DzikuVx)" Date: Mon, 21 Aug 2023 15:29:14 +0200 Subject: [PATCH 3/3] Target updates --- src/main/target/SPEEDYBEEF7MINI/CMakeLists.txt | 2 +- src/main/target/SPEEDYBEEF7MINI/target.c | 2 +- src/main/target/SPEEDYBEEF7MINI/target.h | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/target/SPEEDYBEEF7MINI/CMakeLists.txt b/src/main/target/SPEEDYBEEF7MINI/CMakeLists.txt index d1b5f7e91f8..1ae9febd177 100644 --- a/src/main/target/SPEEDYBEEF7MINI/CMakeLists.txt +++ b/src/main/target/SPEEDYBEEF7MINI/CMakeLists.txt @@ -1,2 +1,2 @@ target_stm32f722xe(SPEEDYBEEF7MINI) -target_stm32f722xe(SPEEDYBEEF7MINI2) +target_stm32f722xe(SPEEDYBEEF7MINIV2) diff --git a/src/main/target/SPEEDYBEEF7MINI/target.c b/src/main/target/SPEEDYBEEF7MINI/target.c index a7da42c07e2..7cc2506b66c 100644 --- a/src/main/target/SPEEDYBEEF7MINI/target.c +++ b/src/main/target/SPEEDYBEEF7MINI/target.c @@ -26,7 +26,7 @@ #include "drivers/pinio.h" #include "drivers/sensor.h" -#ifdef SPEEDYBEEF7MINI2 +#ifdef SPEEDYBEEF7MINIV2 BUSDEV_REGISTER_SPI_TAG(busdev_bmi270, DEVHW_BMI270, BMI270_SPI_BUS, BMI270_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_BMI270_ALIGN); #else BUSDEV_REGISTER_SPI_TAG(busdev_mpu6000, DEVHW_MPU6000, MPU6000_SPI_BUS, MPU6000_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_MPU6000_ALIGN); diff --git a/src/main/target/SPEEDYBEEF7MINI/target.h b/src/main/target/SPEEDYBEEF7MINI/target.h index 8b2e469ceb5..0dd3a6e7a83 100644 --- a/src/main/target/SPEEDYBEEF7MINI/target.h +++ b/src/main/target/SPEEDYBEEF7MINI/target.h @@ -20,8 +20,8 @@ #define TARGET_BOARD_IDENTIFIER "SBMN" -#ifdef SPEEDYBEEF7MINI2 -#define USBD_PRODUCT_STRING "SPEEDYBEEF7MINI2" +#ifdef SPEEDYBEEF7MINIV2 +#define USBD_PRODUCT_STRING "SPEEDYBEEF7MINIV2" #else #define USBD_PRODUCT_STRING "SPEEDYBEEF7MINI" #endif @@ -40,10 +40,10 @@ #define SPI1_MISO_PIN PA6 #define SPI1_MOSI_PIN PA7 -#ifdef SPEEDYBEEF7MINI2 +#ifdef SPEEDYBEEF7MINIV2 #define USE_IMU_BMI270 -#define IMU_BMI270_ALIGN CW0_DEG +#define IMU_BMI270_ALIGN CW180_DEG #define BMI270_CS_PIN PB2 #define BMI270_SPI_BUS BUS_SPI1