Skip to content

Commit

Permalink
Baro fix SPI, probably blackbox, PPM on all targets SS, orientation i…
Browse files Browse the repository at this point in the history
…ssue in some targets and other minor changes in OmnibusF4 (#5187)

* Update target.h

* Invert function

* malformulated function

* PPM on all Omnibus f4 targets

* function reversal & explicit functions without !

* Update target.c

* Update target.c

* Update target.h

* This should repair the faulty orientation #4976

* Update target.c

* Update target.h

* Baro fix spi (#2)

* Update target.h

* Allow override of stm32f7xx UART AFs (#5184)

* Invert function

* Led strip now working on new softserial targets on m5 m6 pin  Omnibus F4v3 (#5186)

* Led Strip 2 SS

Correct this #4968

* Update timer Led strip new Soft Serials

* Update target.c

* Update target.h

* malformulated function

* PPM on all Omnibus f4 targets

* function reversal & explicit functions without !

* Update target.c

* Update target.c

* Update target.h

* This should repair the faulty orientation #4976

* Update target.c

* Update target.h

* Baro fix spi (#3)

* Allow override of stm32f7xx UART AFs (#5184)

* Led strip now working on new softserial targets on m5 m6 pin  Omnibus F4v3 (#5186)

* Led Strip 2 SS

Correct this #4968

* Update timer Led strip new Soft Serials

* PPM on all Omnibus f4 targets

* function reversal & explicit functions without !

* This should repair the faulty orientation #4976

* Specific timers
  • Loading branch information
tiriad authored and DzikuVx committed Nov 15, 2019
1 parent 30c994e commit b2da07f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 40 deletions.
25 changes: 18 additions & 7 deletions src/main/target/OMNIBUSF4/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "drivers/bus.h"

const timerHardware_t timerHardware[] = {
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4PRO_LEDSTRIPM5) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)
DEF_TIM(TIM10, CH1, PB8, TIM_USE_PPM, 0, 0), // PPM
DEF_TIM(TIM4, CH4, PB9, TIM_USE_ANY, 0, 0), // S2_IN
#else
Expand All @@ -42,14 +42,25 @@ const timerHardware_t timerHardware[] = {
DEF_TIM(TIM2, CH3, PA2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO, 0, 0), // S4_OUT D1_ST1

// { TIM9, IO_TAG(PA3), TIM_Channel_2, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM9, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // MOTOR_3
#if (defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)) && !defined(OMNIBUSF4PRO_LEDSTRIPM5)
DEF_TIM(TIM5, CH2, PA1, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO, 0, 0), // S5_OUT
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
DEF_TIM(TIM5, CH2, PA1, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO, 0, 0), // S5_OUT
DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO, 0, 0), // S6_OUT
#elif defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)
DEF_TIM(TIM5, CH2, PA1, TIM_USE_ANY, 0, 0), // S5_OUT SOFTSERIAL
DEF_TIM(TIM1, CH1, PA8, TIM_USE_ANY, 0, 0), // S6_OUT SOFTSERIAL
#elif defined(OMNIBUSF4V3_S6_SS)
DEF_TIM(TIM5, CH2, PA1, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO, 0, 0), // S5_OUT
DEF_TIM(TIM1, CH1, PA8, TIM_USE_ANY, 0, 0), // S6_OUT SOFTSERIAL
#elif defined(OMNIBUSF4PRO_LEDSTRIPM5)
DEF_TIM(TIM5, CH2, PA1, TIM_USE_LED, 0, 0), // S5_OUT LED strip
DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO, 0, 0), // S6_OUT
#else
DEF_TIM(TIM5, CH2, PA1, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO, 0, 0), // S5_OUT
DEF_TIM(TIM5, CH2, PA1, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO | TIM_USE_LED, 0, 0), // S5_OUT MOTOR, SERVO or LED
DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO, 0, 0), // S6_OUT
#endif
DEF_TIM(TIM1, CH1, PA8, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO, 0, 0), // S6_OUT
#if (defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)) && !defined(OMNIBUSF4PRO_LEDSTRIPM5)
DEF_TIM(TIM4, CH1, PB6, TIM_USE_LED, 0, 0), // LED strip for F4 V2 / F4-Pro-0X and later (RCD_CS for F4)

#if (defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS))
DEF_TIM(TIM4, CH1, PB6, TIM_USE_LED, 0, 0), // LED strip for F4 V2 / F4-Pro-0X and later (RCD_CS for F4)
#endif
};

Expand Down
66 changes: 33 additions & 33 deletions src/main/target/OMNIBUSF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,23 @@
#define MPU6000_CS_PIN PA4
#define MPU6000_SPI_BUS BUS_SPI1

#if defined(DYSF4PRO) || defined(DYSF4PROV2)
// Long sentence, OMNIBUSF4 always defined
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4PRO_LEDSTRIPM5) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)
#define USE_GYRO_MPU6000
#define GYRO_MPU6000_ALIGN CW180_DEG
#define GYRO_MPU6000_ALIGN CW270_DEG

#define USE_ACC_MPU6000
#define ACC_MPU6000_ALIGN CW180_DEG
#define ACC_MPU6000_ALIGN CW270_DEG
#else
#define USE_GYRO_MPU6000
#define GYRO_MPU6000_ALIGN CW270_DEG
#define GYRO_MPU6000_ALIGN CW180_DEG

#define USE_ACC_MPU6000
#define ACC_MPU6000_ALIGN CW270_DEG
#define ACC_MPU6000_ALIGN CW180_DEG
#endif

// Support for OMNIBUS F4 PRO CORNER - it has ICM20608 instead of MPU6000
#if !defined(DYSF4PRO) && !defined(DYSF4PROV2)
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4PRO_LEDSTRIPM5) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)
#define MPU6500_CS_PIN MPU6000_CS_PIN
#define MPU6500_SPI_BUS MPU6000_SPI_BUS

Expand All @@ -110,20 +111,19 @@

#define USE_BARO

#if defined(DYSF4PRO) || defined(DYSF4PROV2) || defined(OMNIBUSF4)
#define BARO_I2C_BUS I2C_EXT_BUS
#define USE_BARO_BMP085
#define USE_BARO_BMP280
#define USE_BARO_MS5611
#else
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4PRO_LEDSTRIPM5) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)
#define USE_BARO_BMP280
#define BMP280_SPI_BUS BUS_SPI3
#define BMP280_CS_PIN PB3 // v1

// Support external barometers
#define BARO_I2C_BUS I2C_EXT_BUS
#define USE_BARO_BMP085
#define USE_BARO_MS5611
#else
#define BARO_I2C_BUS I2C_EXT_BUS
#define USE_BARO_BMP085
#define USE_BARO_BMP280
#define USE_BARO_MS5611
#endif

#define PITOT_I2C_BUS I2C_EXT_BUS
Expand Down Expand Up @@ -166,26 +166,26 @@

#elif defined(OMNIBUSF4V3_S6_SS) // one softserial on S6
#define USE_SOFTSERIAL1
#define SOFTSERIAL_1_RX_PIN PA8 // shared with S6 output
#define SOFTSERIAL_1_TX_PIN PA8 // shared with S6 output
#define SOFTSERIAL_1_RX_PIN PA8 // S6 output
#define SOFTSERIAL_1_TX_PIN PA8 // S6 output

#define SERIAL_PORT_COUNT 5 // VCP, USART1, USART3, USART6, SOFTSERIAL1

#elif defined(OMNIBUSF4V3_S5S6_SS) // one softserial on S5/RX S6/TX
#define USE_SOFTSERIAL1
#define SOFTSERIAL_1_RX_PIN PA1 // shared with S5 output
#define SOFTSERIAL_1_TX_PIN PA8 // shared with S6 output
#define SOFTSERIAL_1_RX_PIN PA1 // S5 output
#define SOFTSERIAL_1_TX_PIN PA8 // S6 output

#define SERIAL_PORT_COUNT 5 // VCP, USART1, USART3, USART6, SOFTSERIAL1

#elif defined(OMNIBUSF4V3_S5_S6_2SS) // two softserials, one on S5 and one on S6
#define USE_SOFTSERIAL1
#define SOFTSERIAL_1_RX_PIN PA1 // shared with S5 output
#define SOFTSERIAL_1_TX_PIN PA1 // shared with S5 output
#define SOFTSERIAL_1_RX_PIN PA1 // S5 output
#define SOFTSERIAL_1_TX_PIN PA1 // S5 output

#define USE_SOFTSERIAL2
#define SOFTSERIAL_2_RX_PIN PA8 // shared with S6 output
#define SOFTSERIAL_2_TX_PIN PA8 // shared with S6 output
#define SOFTSERIAL_2_RX_PIN PA8 // S6 output
#define SOFTSERIAL_2_TX_PIN PA8 // S6 output

#define SERIAL_PORT_COUNT 6 // VCP, USART1, USART3, USART6, SOFTSERIAL1, SOFTSERIAL2

Expand All @@ -201,7 +201,7 @@

#define USE_SPI_DEVICE_1

#if !defined(DYSF4PRO) && !defined(DYSF4PROV2) && !defined(OMNIBUSF4)
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4PRO_LEDSTRIPM5) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)
#define USE_SPI_DEVICE_2
#define SPI2_NSS_PIN PB12
#define SPI2_SCK_PIN PB13
Expand All @@ -210,7 +210,7 @@
#endif

#define USE_SPI_DEVICE_3
#if !defined(DYSF4PRO) && !defined(DYSF4PROV2) && !defined(OMNIBUSF4)
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4PRO_LEDSTRIPM5) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)
#define SPI3_NSS_PIN PA15
#else
#define SPI3_NSS_PIN PB3
Expand All @@ -224,13 +224,7 @@
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15

#if defined(DYSF4PRO) || defined(DYSF4PROV2) || defined(OMNIBUSF4)
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
#define M25P16_CS_PIN SPI3_NSS_PIN
#define M25P16_SPI_BUS BUS_SPI3
#define USE_FLASHFS
#define USE_FLASH_M25P16
#else
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4PRO_LEDSTRIPM5) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
#define USE_SDCARD
#define USE_SDCARD_SPI
Expand All @@ -240,6 +234,12 @@

#define SDCARD_DETECT_PIN PB7
#define SDCARD_DETECT_INVERTED
#else
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
#define M25P16_CS_PIN SPI3_NSS_PIN
#define M25P16_SPI_BUS BUS_SPI3
#define USE_FLASHFS
#define USE_FLASH_M25P16
#endif

#define USE_ADC
Expand All @@ -259,10 +259,10 @@
#define SENSORS_SET (SENSOR_ACC|SENSOR_MAG|SENSOR_BARO)

#define USE_LED_STRIP
#if (defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS)) && !defined(OMNIBUSF4PRO_LEDSTRIPM5)
# define WS2811_PIN PB6
#if (defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS))
#define WS2811_PIN PB6
#else
# define WS2811_PIN PA1
#define WS2811_PIN PA1
#endif

#define DEFAULT_RX_TYPE RX_TYPE_PPM
Expand Down

0 comments on commit b2da07f

Please sign in to comment.