Skip to content

Commit

Permalink
add SKYSTARSSF405AIO target
Browse files Browse the repository at this point in the history
  • Loading branch information
DusKing1 committed Nov 19, 2024
1 parent 88cc87d commit df7b731
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/main/target/SKYSTARSF405HD/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target_stm32f405xg(SKYSTARSF405HD)
target_stm32f405xg(SKYSTARSF405HD2)
target_stm32f405xg(SKYSTARSF405HD2)
target_stm32f405xg(SKYSTARSF405AIO)
6 changes: 6 additions & 0 deletions src/main/target/SKYSTARSF405HD/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@
#include "io/serial.h"
#include "rx/rx.h"
#include "drivers/pwm_mapping.h"
#include "sensors/boardalignment.h"

void targetConfiguration(void)
{
serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART6)].functionMask = FUNCTION_DJI_HD_OSD;

// 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

}
2 changes: 1 addition & 1 deletion src/main/target/SKYSTARSF405HD/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 11 additions & 4 deletions src/main/target/SKYSTARSF405HD/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit df7b731

Please sign in to comment.