From df7b7319d78339e5ffee6889474ab11ee8e36ebe Mon Sep 17 00:00:00 2001 From: Hugo Chiang Date: Sat, 16 Nov 2024 19:52:03 +0800 Subject: [PATCH] add SKYSTARSSF405AIO target --- src/main/target/SKYSTARSF405HD/CMakeLists.txt | 3 ++- src/main/target/SKYSTARSF405HD/config.c | 6 ++++++ src/main/target/SKYSTARSF405HD/target.c | 2 +- src/main/target/SKYSTARSF405HD/target.h | 15 +++++++++++---- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/main/target/SKYSTARSF405HD/CMakeLists.txt b/src/main/target/SKYSTARSF405HD/CMakeLists.txt index b097558284c..daa0577d443 100644 --- a/src/main/target/SKYSTARSF405HD/CMakeLists.txt +++ b/src/main/target/SKYSTARSF405HD/CMakeLists.txt @@ -1,2 +1,3 @@ target_stm32f405xg(SKYSTARSF405HD) -target_stm32f405xg(SKYSTARSF405HD2) \ No newline at end of file +target_stm32f405xg(SKYSTARSF405HD2) +target_stm32f405xg(SKYSTARSF405AIO) \ No newline at end of file diff --git a/src/main/target/SKYSTARSF405HD/config.c b/src/main/target/SKYSTARSF405HD/config.c index b34785c5b7d..ff0dffc7428 100644 --- a/src/main/target/SKYSTARSF405HD/config.c +++ b/src/main/target/SKYSTARSF405HD/config.c @@ -23,6 +23,7 @@ #include "io/serial.h" #include "rx/rx.h" #include "drivers/pwm_mapping.h" +#include "sensors/boardalignment.h" void targetConfiguration(void) { @@ -30,4 +31,9 @@ void targetConfiguration(void) // To improve backwards compatibility with INAV versions 6.x and older timerOverridesMutable(timer2id(TIM2))->outputMode = OUTPUT_MODE_MOTORS; + +#if defined(SKYSTARSF405AIO) + boardAlignmentMutable()->yawDeciDegrees = 450; +#endif + } diff --git a/src/main/target/SKYSTARSF405HD/target.c b/src/main/target/SKYSTARSF405HD/target.c index cc4ff1c5a88..8e5a4663b3c 100644 --- a/src/main/target/SKYSTARSF405HD/target.c +++ b/src/main/target/SKYSTARSF405HD/target.c @@ -28,7 +28,7 @@ timerHardware_t timerHardware[] = { DEF_TIM(TIM4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 0, 0), DEF_TIM(TIM3, CH1, PB4, TIM_USE_OUTPUT_AUTO, 0, 0), DEF_TIM(TIM2, CH2, PB3, TIM_USE_OUTPUT_AUTO, 0, 0), -#if defined(SKYSTARSF405HD2) +#if defined(SKYSTARSF405HD2) || defined(SKYSTARSF405AIO) DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 0), #endif diff --git a/src/main/target/SKYSTARSF405HD/target.h b/src/main/target/SKYSTARSF405HD/target.h index 9b9805084f2..c3711fcb4c2 100644 --- a/src/main/target/SKYSTARSF405HD/target.h +++ b/src/main/target/SKYSTARSF405HD/target.h @@ -36,17 +36,14 @@ #define SPI1_MOSI_PIN PA7 #define USE_IMU_MPU6000 -#define IMU_MPU6000_ALIGN CW180_DEG_FLIP #define MPU6000_SPI_BUS BUS_SPI1 #define MPU6000_CS_PIN PA4 #define USE_IMU_BMI270 -#define IMU_BMI270_ALIGN CW180_DEG_FLIP #define BMI270_SPI_BUS BUS_SPI1 #define BMI270_CS_PIN PA4 #define USE_IMU_ICM42605 -#define IMU_ICM42605_ALIGN CW180_DEG_FLIP #define ICM42605_SPI_BUS BUS_SPI1 #define ICM42605_CS_PIN PA4 @@ -156,8 +153,18 @@ #define USE_DSHOT #define USE_ESC_SENSOR -#if defined(SKYSTARSF405HD2) +#if defined(SKYSTARSF405HD2) || defined(SKYSTARSF405AIO) #define MAX_PWM_OUTPUT_PORTS 6 #else #define MAX_PWM_OUTPUT_PORTS 4 #endif + +#if defined(SKYSTARSF405AIO) +#define IMU_MPU6000_ALIGN CW0_DEG +#define IMU_BMI270_ALIGN CW0_DEG +#define IMU_ICM42605_ALIGN CW0_DEG +#else +#define IMU_MPU6000_ALIGN CW180_DEG_FLIP +#define IMU_BMI270_ALIGN CW180_DEG_FLIP +#define IMU_ICM42605_ALIGN CW180_DEG_FLIP +#endif