diff --git a/src/main/target/COLIBRI_RACE/target.h b/src/main/target/COLIBRI_RACE/target.h index 0492926e5..8fb4cee7a 100755 --- a/src/main/target/COLIBRI_RACE/target.h +++ b/src/main/target/COLIBRI_RACE/target.h @@ -32,11 +32,6 @@ #define BEEPER_INVERTED #define USE_EXTI -#define MPU6500_CS_PIN PA4 -#define MPU6500_SPI_INSTANCE SPI1 - -#define MPU6000_CS_PIN PA4 -#define MPU6000_SPI_INSTANCE SPI1 #define USE_SPI #define USE_SPI_DEVICE_1 @@ -44,6 +39,13 @@ #define SPI1_SCK_PIN PB3 #define SPI1_MISO_PIN PB4 #define SPI1_MOSI_PIN PB5 +#define SPI1_NSS_PIN PA4 + +#define MPU6500_CS_PIN SPI1_NSS_PIN +#define MPU6500_SPI_INSTANCE SPI1 + +#define MPU6000_CS_PIN SPI1_NSS_PIN +#define MPU6000_SPI_INSTANCE SPI1 #define USABLE_TIMER_CHANNEL_COUNT 11 diff --git a/src/main/target/DOGE/target.h b/src/main/target/DOGE/target.h index 7ca509ea2..c790c5242 100644 --- a/src/main/target/DOGE/target.h +++ b/src/main/target/DOGE/target.h @@ -33,14 +33,6 @@ #define BEEPER PB2 #define BEEPER_INVERTED -// tqfp48 pin 3 -#define MPU6500_CS_PIN PC14 -#define MPU6500_SPI_INSTANCE SPI1 - -// tqfp48 pin 25 -#define BMP280_CS_PIN PB12 -#define BMP280_SPI_INSTANCE SPI2 - #define USE_SPI #define USE_SPI_DEVICE_1 #define USE_SPI_DEVICE_2 @@ -51,18 +43,31 @@ #define SPI1_MISO_PIN PB4 // tqfp48 pin 41 #define SPI1_MOSI_PIN PB5 +// tqfp48 pin 3 +#define SPI1_NSS_PIN PC14 + // tqfp48 pin 26 #define SPI2_SCK_PIN PB13 // tqfp48 pin 27 #define SPI2_MISO_PIN PB14 // tqfp48 pin 28 #define SPI2_MOSI_PIN PB15 +// tqfp48 pin 25 +#define SPI2_NSS_PIN PB12 + +// tqfp48 pin 3 +#define MPU6500_CS_PIN SPI1_NSS_PIN +#define MPU6500_SPI_INSTANCE SPI1 + +// tqfp48 pin 25 +#define BMP280_CS_PIN SPI2_NSS_PIN +#define BMP280_SPI_INSTANCE SPI2 #define USE_FLASHFS #define USE_FLASH_M25P16 #define M25P16_SPI_SHARED -#define M25P16_CS_PIN PC15 -#define M25P16_SPI_INSTANCE SPI2 +#define M25P16_CS_PIN PC15 +#define M25P16_SPI_INSTANCE SPI2 // timer definitions in drivers/timer.c // channel mapping in drivers/pwm_mapping.c diff --git a/src/main/target/LUX_RACE/target.h b/src/main/target/LUX_RACE/target.h index cef9b31b0..600bd2ee6 100644 --- a/src/main/target/LUX_RACE/target.h +++ b/src/main/target/LUX_RACE/target.h @@ -29,17 +29,16 @@ #define BEEPER PB13 #define BEEPER_INVERTED -#define MPU6500_CS_GPIO_CLK_PERIPHERAL RCC_AHBPeriph_GPIOA -#define MPU6500_CS_GPIO GPIOA -#define MPU6500_CS_PIN PA4 -#define MPU6500_SPI_INSTANCE SPI1 - #define USE_SPI #define USE_SPI_DEVICE_1 #define SPI1_SCK_PIN PB3 #define SPI1_MISO_PIN PB4 #define SPI1_MOSI_PIN PB5 +#define SPI1_NSS_PIN PA4 + +#define MPU6500_CS_PIN SPI1_NSS_PIN +#define MPU6500_SPI_INSTANCE SPI1 #define USABLE_TIMER_CHANNEL_COUNT 11