Skip to content

Commit

Permalink
[target] FLYWOOF7DUAL add ICM42688P; update timers (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdCopter authored Apr 17, 2024
1 parent 967586b commit 7763234
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 24 deletions.
5 changes: 4 additions & 1 deletion src/main/target/FLYWOOF7DUAL/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
DEF_TIM(TIM2, CH1, PA15, TIM_USE_MOTOR, 0, 0), // S4 (1,5)
DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 1), // S5 (2,4)
DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0), // S6 (2,1)
DEF_TIM(TIM8, CH1, PC6, TIM_USE_PPM, 0, 0), // ppm RX_PPM_PIN
DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 0), // LED STRIP(2,6)
DEF_TIM(TIM4, CH3, PB8, TIM_USE_ANY, 0, 0), // FC CAM(1,7)

DEF_TIM(TIM2, CH3, PB10, TIM_USE_PWM, 0, 0), // pwm RX_PWM1_PIN
DEF_TIM(TIM5, CH3, PA2, TIM_USE_PWM, 0, 0), // pwm RX_PWM2_PIN
DEF_TIM(TIM5, CH4, PA3, TIM_USE_PWM, 0, 1), // pwm RX_PWM3_PIN
};
51 changes: 28 additions & 23 deletions src/main/target/FLYWOOF7DUAL/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@

#pragma once

#define TARGET_BOARD_IDENTIFIER "FWF7"
#define USBD_PRODUCT_STRING "FLYWOOF7DUAL"
#define BOARD_NAME FLYWOOF7DUAL
#define MANUFACTURER_ID FLWO
#define TARGET_BOARD_IDENTIFIER "S7X2" // generic ID
#define FC_TARGET_MCU STM32F7X2 // not used in EmuF

#define ENABLE_DSHOT_DMAR true

Expand Down Expand Up @@ -66,37 +68,40 @@

#define CAMERA_CONTROL_PIN PB8

#define USE_DUAL_GYRO
#define USE_SPI_GYRO
#define USE_EXTI
#define GYRO_1_EXTI_PIN PC3
#define GYRO_2_EXTI_PIN PC4
#define MPU_INT_EXTI PC3
#define USE_GYRO_EXTI

#define USE_MPU_DATA_READY_SIGNAL
#define ENSURE_MPU_DATA_READY_IS_LOW

#define GYRO_1_CS_PIN PA4
#define GYRO_1_SPI_INSTANCE SPI1
#define GYRO_2_CS_PIN PB2
#define GYRO_2_SPI_INSTANCE SPI1

#define USE_MPU_DATA_READY_SIGNAL
#define ENSURE_MPU_DATA_READY_IS_LOW

#define USE_GYRO
#define USE_GYRO_SPI_MPU6000
#define USE_GYRO_SPI_ICM20689

#define USE_ACC
#define USE_GYRO_SPI_MPU6000
#define USE_ACC_SPI_MPU6000
#define USE_GYRO_SPI_ICM20689
#define USE_ACC_SPI_ICM20689
#define USE_GYRO_SPI_ICM42688P
#define USE_ACC_SPI_ICM42688P

#define ACC_1_ALIGN CW180_DEG_FLIP
#define GYRO_1_ALIGN CW180_DEG_FLIP
#define GYRO_1_CS_PIN PA4
#define GYRO_1_EXTI_PIN PC3
#define GYRO_1_SPI_INSTANCE SPI1

#define ACC_MPU6000_1_ALIGN CW180_DEG_FLIP
#define GYRO_MPU6000_1_ALIGN CW180_DEG_FLIP
#define GYRO_1_ALIGN GYRO_MPU6000_1_ALIGN
#define ACC_1_ALIGN ACC_MPU6000_1_ALIGN
#define USE_DUAL_GYRO

#define ACC_ICM20689_2_ALIGN CW270_DEG
#define GYRO_ICM20689_2_ALIGN CW270_DEG
#define GYRO_2_ALIGN GYRO_ICM20689_2_ALIGN
#define ACC_2_ALIGN ACC_ICM20689_2_ALIGN
#define ACC_2_ALIGN CW270_DEG
#define GYRO_2_ALIGN CW270_DEG
#define GYRO_2_CS_PIN PB2
#define GYRO_2_EXTI_PIN PC4
#define GYRO_2_SPI_INSTANCE SPI1

#define GYRO_CONFIG_USE_GYRO_DEFAULT GYRO_CONFIG_USE_GYRO_1

Expand Down Expand Up @@ -156,7 +161,7 @@
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC

#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
#define DEFAULT_FEATURES (FEATURE_RSSI_ADC | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_LED_STRIP)
#define DEFAULT_FEATURES (FEATURE_RSSI_ADC | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_AIRMODE | FEATURE_LED_STRIP)
#define SERIALRX_UART SERIAL_PORT_USART1
#define SERIALRX_PROVIDER SERIALRX_SBUS

Expand All @@ -174,5 +179,5 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))

#define USABLE_TIMER_CHANNEL_COUNT 9
#define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) |TIM_N(11) )
#define USABLE_TIMER_CHANNEL_COUNT 12
#define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8) | TIM_N(10) )
1 change: 1 addition & 0 deletions src/main/target/FLYWOOF7DUAL/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ TARGET_SRC = \
drivers/accgyro/accgyro_mpu.c \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/accgyro/accgyro_spi_icm20689.c \
drivers/accgyro/accgyro_spi_icm426xx.c \
drivers/barometer/barometer_bmp280.c \
drivers/barometer/barometer_ms5611.c \
drivers/compass/compass_hmc5883l.c \
Expand Down

0 comments on commit 7763234

Please sign in to comment.