From 309c918d8285a2d490267accde58d74605c9e0b6 Mon Sep 17 00:00:00 2001 From: czchc Date: Thu, 11 Jan 2018 16:36:45 +0800 Subject: [PATCH 1/2] add LED strip support for bbv2 --- src/main/target/BEEBRAIN_V2F/target.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/target/BEEBRAIN_V2F/target.c b/src/main/target/BEEBRAIN_V2F/target.c index d140755d67..df052fa824 100644 --- a/src/main/target/BEEBRAIN_V2F/target.c +++ b/src/main/target/BEEBRAIN_V2F/target.c @@ -25,9 +25,9 @@ #include "drivers/timer_def.h" const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { - DEF_TIM(TIM1, CH3N, PB15, TIM_USE_MOTOR, 0), // PWM1 - PB15 - DMA1_CH6 - *TIM1_CH3N, TIM15_CH1N, TIM15_CH2 - DEF_TIM(TIM15, CH1, PB14, TIM_USE_MOTOR, 0), // PWM2 - PB14 - DMA1_CH5 - TIM1_CH2N, *TIM15_CH1 - DEF_TIM(TIM1, CH1, PA8, TIM_USE_MOTOR, 0), // PWM3 - PA8 - DMA1_CH2 - *TIM1_CH1, TIM4_ETR - DEF_TIM(TIM8, CH2N, PB0, TIM_USE_MOTOR, 0), // PWM4 - PB0 - DMA2_CH5 - TIM3_CH3, TIM1_CH2N, *TIM8_CH2N - DEF_TIM(TIM16, CH1, PB8, TIM_USE_TRANSPONDER, 0), + DEF_TIM(TIM1, CH3N, PB15, TIM_USE_MOTOR, 0), // PWM1 - PB15 - DMA1_CH6 - *TIM1_CH3N, TIM15_CH1N, TIM15_CH2 + DEF_TIM(TIM15, CH1, PB14, TIM_USE_MOTOR, 0), // PWM2 - PB14 - DMA1_CH5 - TIM1_CH2N, *TIM15_CH1 + DEF_TIM(TIM1, CH1, PA8, TIM_USE_MOTOR, 0), // PWM3 - PA8 - DMA1_CH2 - *TIM1_CH1, TIM4_ETR + DEF_TIM(TIM8, CH2N, PB0, TIM_USE_MOTOR, 0), // PWM4 - PB0 - DMA2_CH5 - TIM3_CH3, TIM1_CH2N, *TIM8_CH2N + DEF_TIM(TIM16, CH1, PB8, TIM_USE_TRANSPONDER | TIM_USE_LED, 0), }; From 38f9e11b3c275ccad3eaef50172f19df8737efb6 Mon Sep 17 00:00:00 2001 From: czchc Date: Thu, 11 Jan 2018 17:57:32 +0800 Subject: [PATCH 2/2] set angle mode as default --- src/main/target/BEEBRAIN_V2F/config.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/target/BEEBRAIN_V2F/config.c b/src/main/target/BEEBRAIN_V2F/config.c index cdf570bcad..415961f3e5 100644 --- a/src/main/target/BEEBRAIN_V2F/config.c +++ b/src/main/target/BEEBRAIN_V2F/config.c @@ -33,6 +33,8 @@ #include "fc/config.h" #include "fc/controlrate_profile.h" +#include "fc/rc_modes.h" +#include "fc/rc_controls.h" #include "flight/mixer.h" #include "flight/pid.h" @@ -140,6 +142,11 @@ void targetConfiguration(void) osdConfigMutable()->item_pos[OSD_ESC_TMP] &= ~VISIBLE_FLAG; osdConfigMutable()->item_pos[OSD_ESC_RPM] &= ~VISIBLE_FLAG; + modeActivationConditionsMutable(0)->modeId = BOXANGLE; + modeActivationConditionsMutable(0)->auxChannelIndex = AUX2 - AUX1; + modeActivationConditionsMutable(0)->range.startStep = CHANNEL_VALUE_TO_STEP(900); + modeActivationConditionsMutable(0)->range.endStep = CHANNEL_VALUE_TO_STEP(2100); + #if defined(BEEBRAIN_V2D) // DSM version for (uint8_t rxRangeIndex = 0; rxRangeIndex < NON_AUX_CHANNEL_COUNT; rxRangeIndex++) {