Add deprecated checking for CAMERA_CONTROL_PIN

Handle targets that currently define CAMERA_CONTROL_PIN

- Targets with a valid timer entry for the pin: Def is just deleted.

- Targets without a valid timer entry for the pin: Def is commented out and additional comment is added. The camera control function must have not being working for a long timer for the target anyway.
This commit is contained in:
jflyper 2019-10-03 01:19:12 +09:00
parent 564f3031b2
commit 8776e5ab17
13 changed files with 25 additions and 21 deletions

View File

@ -30,7 +30,7 @@
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
DEF_TIM(TIM2, CH1, PA15, TIM_USE_LED, 0, 0), // ONBOARD LED
DEF_TIM(TIM1, CH1, PA8, TIM_USE_ANY, 0, 0), // CAM CONTROL
DEF_TIM(TIM1, CH1, PA8, TIM_USE_CAMERA_CONTROL,0, 0), // CAM CONTROL
// MOTORS

View File

@ -120,10 +120,6 @@
#define SERIALRX_PROVIDER SERIALRX_SBUS
#define SERIALRX_UART SERIAL_PORT_USART6
// *************** CAM *****************************
#define CAMERA_CONTROL_PIN PA8
// *************** I2C *****************************
#define USE_I2C

View File

@ -36,8 +36,6 @@
#define INVERTER_PIN_UART1 PC0 // PC0 used as inverter select GPIO
#define CAMERA_CONTROL_PIN PB9 // define dedicated camera_osd_control pin
#define USE_EXTI
#define USE_GYRO_EXTI

View File

@ -39,7 +39,9 @@
#define BARO_I2C_INSTANCE (I2CDEV_1)
#define DEFAULT_BARO_QMP6988
#define CAMERA_CONTROL_PIN PA5
// XXX CAMERA_CONTROL_PIN is deprecated.
// XXX Target maintainer must create a valid timerHardware[] array entry for PA5 with TIM_USE_CAMERA_CONTROL
//#define CAMERA_CONTROL_PIN PA5
#define USE_SPI
#define USE_SPI_DEVICE_1

View File

@ -40,7 +40,9 @@
#define BARO_I2C_INSTANCE (I2CDEV_1)
#define DEFAULT_BARO_QMP6988
#define CAMERA_CONTROL_PIN PB5
// XXX CAMERA_CONTROL_PIN is deprecated.
// XXX Target maintainer must create a valid timerHardware[] array entry for PB5 with TIM_USE_CAMERA_CONTROL
//#define CAMERA_CONTROL_PIN PB5
#define USE_SPI
#define USE_SPI_DEVICE_1

View File

@ -44,8 +44,6 @@
#define USE_BEEPER
#if defined(FLYWOOF405)
//define camera control
#define CAMERA_CONTROL_PIN PA9
#define BEEPER_PIN PC13
#else
#define BEEPER_PIN PC9

View File

@ -28,7 +28,9 @@
#include "drivers/timer_def.h"
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
DEF_TIM(TIM1, CH3, PE13, TIM_USE_PPM, 0, 1), // PPM, DMA2_ST6
// XXX TIM_USE_CAMERA_CONTROL is added to handle deprecated CAMERA_CONTROL_PIN def in target.h
// XXX Target maintainer must confirm intended operation after this change.
DEF_TIM(TIM1, CH3, PE13, TIM_USE_PPM|TIM_USE_CAMERA_CONTROL, 0, 1), // PPM, DMA2_ST6
DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0, 0), // M1 , DMA1_ST7
DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0), // M2 , DMA1_ST2

View File

@ -39,8 +39,11 @@
#define BEEPER_PIN PD15
#define BEEPER_INVERTED
// XXX CAMERA_CONTROL_PIN is deprecated, so it was moved to PE13 entry in timerHardware[] array,
// XXX where it is shared with PPM.
// XXX Target maintainer must confirm intended operation under this change.
//define camera control
#define CAMERA_CONTROL_PIN PE13
//#define CAMERA_CONTROL_PIN PE13
#define USE_ACC
#define USE_GYRO

View File

@ -34,7 +34,9 @@
#define PINIO1_PIN PB12 //VTX Power Switch
#define USE_PINIOBOX
#define CAMERA_CONTROL_PIN PB8 //Camera OSD
// XXX CAMERA_CONTROL_PIN is deprecated.
// XXX Target maintainer must create a valid timerHardware[] array entry for PB8 with TIM_USE_CAMERA_CONTROL
//#define CAMERA_CONTROL_PIN PB8 //Camera OSD
#define USE_BEEPER

View File

@ -45,8 +45,9 @@
//define camera control
#if defined(PIRXF4)
#define USE_CAMERA_CONTROL
#define CAMERA_CONTROL_PIN PA4
// XXX CAMERA_CONTROL_PIN is deprecated.
// XXX Target maintainer must create a valid timerHardware[] array entry for PA4 with TIM_USE_CAMERA_CONTROL
//#define CAMERA_CONTROL_PIN PA4
#endif
//BEEPER

View File

@ -30,7 +30,7 @@
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
DEF_TIM(TIM2, CH1, PA15, TIM_USE_LED, 0, 0), // ONBOARD LED
DEF_TIM(TIM1, CH1, PA8, TIM_USE_ANY, 0, 0), // CAM CONTROL
DEF_TIM(TIM1, CH1, PA8, TIM_USE_CAMERA_CONTROL,0, 0), // CAM CONTROL
// MOTORS

View File

@ -112,10 +112,6 @@
#define SERIALRX_PROVIDER SERIALRX_SBUS
#define SERIALRX_UART SERIAL_PORT_USART1
// *************** CAM *****************************
#define CAMERA_CONTROL_PIN PA8
// *************** PIN *****************************
#define PINIO1_PIN PB1

View File

@ -147,3 +147,7 @@
#if DMARXCAT(ENABLE_DSHOT_DMAR) == 1 || DMARXCAT(ENABLE_DSHOT_DMAR) == 1
#error "Use DSHOT_DMAR_ON or DSHOT_DMAR_OFF instead of boolean values for ENABLE_DSHOT_DMAR"
#endif
#ifdef CAMERA_CONTROL_PIN
#error "The CAMERA_CONTROL_PIN define in target.h is deprecated. Use timerHardware[] array entry with TIM_USE_CAMERA_CONTROL"
#endif