From c3b218f9b5543497de38309b12e1fe17f0634c93 Mon Sep 17 00:00:00 2001 From: jflyper Date: Mon, 22 Jan 2018 11:08:08 +0900 Subject: [PATCH] Refactor pin assignment - Assign valid timers for PWM5 and 6 - Streamline PWM1 through 4 for burst Dshot operation - PWM5 and 6 are assigned different timers to maximize flexibility. --- src/main/target/IMPULSERCF3/target.c | 14 +++++++------- src/main/target/IMPULSERCF3/target.h | 9 ++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main/target/IMPULSERCF3/target.c b/src/main/target/IMPULSERCF3/target.c index 4d692f261..4bce70864 100644 --- a/src/main/target/IMPULSERCF3/target.c +++ b/src/main/target/IMPULSERCF3/target.c @@ -26,11 +26,11 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM2, CH1, PA15, TIM_USE_PPM, 0), // PPM IN - DEF_TIM(TIM16, CH1, PB4, TIM_USE_MOTOR, 0), // PWM1 - DEF_TIM(TIM17, CH1, PB5, TIM_USE_MOTOR, 0), // PWM2 - DEF_TIM(TIM8, CH3N, PB1, TIM_USE_MOTOR, 0), // PWM3 - DEF_TIM(TIM8, CH2N, PB0, TIM_USE_MOTOR, 0), // PWM4 - DEF_TIM(TIM16, CH1, PB8, TIM_USE_MOTOR, 0), // PWM5 - DEF_TIM(TIM17, CH1, PB9, TIM_USE_MOTOR, 0), // PWM6 - DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0), // LED_STRIP + DEF_TIM(TIM3, CH1, PB4, TIM_USE_MOTOR, 0), // PWM1 UP(1,3) + DEF_TIM(TIM3, CH2, PB5, TIM_USE_MOTOR, 0), // PWM2 + DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0), // PWM3 + DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0), // PWM4 + DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0), // PWM5 UP(1,7) + DEF_TIM(TIM8, CH3, PB9, TIM_USE_MOTOR, 0), // PWM6 UP(2,1) + DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0), // LED_STRIP D(1,2) }; diff --git a/src/main/target/IMPULSERCF3/target.h b/src/main/target/IMPULSERCF3/target.h index 9ccd09c17..9dd3b9dfa 100644 --- a/src/main/target/IMPULSERCF3/target.h +++ b/src/main/target/IMPULSERCF3/target.h @@ -21,12 +21,12 @@ #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_NONE +#define USE_DSHOT_DMAR + #define LED0_PIN PB7 #define BEEPER PC15 -#define USABLE_TIMER_CHANNEL_COUNT 8 - #define USE_EXTI #define MPU_INT_EXTI PC13 #define USE_MPU_DATA_READY_SIGNAL @@ -44,8 +44,6 @@ #define USE_FLASH_M25P16 #define USE_ESC_SENSOR -#define REMAP_TIM17_DMA -#define REMAP_TIM16_DMA #define USE_VCP #define USE_UART1 @@ -111,4 +109,5 @@ #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15)) #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4)) -#define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(8) | TIM_N(16) |TIM_N(17)) +#define USABLE_TIMER_CHANNEL_COUNT 8 +#define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8))