diff --git a/src/main/drivers/timer_def.h b/src/main/drivers/timer_def.h index b138f4b07..9d119d731 100644 --- a/src/main/drivers/timer_def.h +++ b/src/main/drivers/timer_def.h @@ -553,9 +553,9 @@ #define DEF_TIM_DMA__BTCH_TIM5_CH3 D(1, 0, 6) #define DEF_TIM_DMA__BTCH_TIM5_CH4 D(1, 1, 6),D(1, 3, 6) -#define DEF_TIM_DMA__BTCH_TIM8_CH1 D(2, 2, 7),D(2, 2, 0) -#define DEF_TIM_DMA__BTCH_TIM8_CH2 D(2, 3, 7),D(2, 2, 0) -#define DEF_TIM_DMA__BTCH_TIM8_CH3 D(2, 4, 7),D(2, 2, 0) +#define DEF_TIM_DMA__BTCH_TIM8_CH1 D(2, 2, 0),D(2, 2, 7) +#define DEF_TIM_DMA__BTCH_TIM8_CH2 D(2, 2, 0),D(2, 3, 7) +#define DEF_TIM_DMA__BTCH_TIM8_CH3 D(2, 2, 0),D(2, 4, 7) #define DEF_TIM_DMA__BTCH_TIM8_CH4 D(2, 7, 7) #define DEF_TIM_DMA__BTCH_TIM4_CH4 NONE diff --git a/src/main/target/AG3X/target.c b/src/main/target/AG3X/target.c index ac82d51e5..5458ee3aa 100644 --- a/src/main/target/AG3X/target.c +++ b/src/main/target/AG3X/target.c @@ -28,14 +28,14 @@ #include "drivers/timer_def.h" const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { - // ADC1 D(2,4) D(2,0) + // ADC1 *D(2,4) D(2,0) // ADC2 D(2,2) D(2,3) // ADC3 D(2,0) D(2,1) DEF_TIM(TIM1, CH1, PA8, TIM_USE_PPM, 0, 0), // PPM D(1,0) // Motors - DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0), // MOTOR1 U(2,1) D(2,2) D(2,4) + DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0), // MOTOR1 U(2,1) *D(2,2) D(2,4) DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0, 0), // MOTOR2 U(1,2) D(1,7) DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0), // MOTOR3 U(1,2) D(1,2) DEF_TIM(TIM4, CH2, PB7, TIM_USE_MOTOR, 0, 0), // MOTOR4 U(1,6) D(1,3) diff --git a/src/main/target/ALIENFLIGHTNGF7/target.c b/src/main/target/ALIENFLIGHTNGF7/target.c index a93edbd1e..ce5f5ef71 100644 --- a/src/main/target/ALIENFLIGHTNGF7/target.c +++ b/src/main/target/ALIENFLIGHTNGF7/target.c @@ -35,10 +35,10 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM1, CH1, PA8, TIM_USE_PPM | TIM_USE_LED, 0, 1), // PPM - DMA2_ST6, *DMA2_ST1, DMA2_ST3 DEF_TIM(TIM8, CH1, PC6, TIM_USE_MOTOR, 0, 0), // PWM1 - DMA2_ST2, DMA2_ST2 DEF_TIM(TIM3, CH2, PC7, TIM_USE_MOTOR, 0, 0), // PWM2 - DMA1_ST5 - DEF_TIM(TIM8, CH2N, PB14, TIM_USE_MOTOR, 0, 0), // PWM3 - DMA2_ST3, DMA2_ST2 + DEF_TIM(TIM8, CH2N, PB14, TIM_USE_MOTOR, 0, 1), // PWM3 - DMA2_ST3, DMA2_ST2 DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0, 0), // PWM4 - DMA1_ST7 DEF_TIM(TIM5, CH1, PA0, TIM_USE_MOTOR, 0, 0), // PWM5 - DMA1_ST2 - DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0), // PWM6 - (DMA2_ST4) DMA2_ST2 + DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 1), // PWM6 - (DMA2_ST4) DMA2_ST2 DEF_TIM(TIM5, CH2, PA1, TIM_USE_MOTOR, 0, 0), // PWM7 - (DMA1_ST4) - DMA SDCard, DMA Serial_TX4 DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0), // PWM8 - (DMA2_ST7) - DMA Serial_TX1 DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0), // PWM9 - (DMA1_ST2) - Collision diff --git a/src/main/target/ANYFCF7/target.c b/src/main/target/ANYFCF7/target.c index 17dab5159..c1269441d 100644 --- a/src/main/target/ANYFCF7/target.c +++ b/src/main/target/ANYFCF7/target.c @@ -31,8 +31,8 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM12, CH1, PB14, TIM_USE_PWM | TIM_USE_PPM, 0, 0 ), // S1_IN DEF_TIM(TIM12, CH2, PB15, TIM_USE_PWM, 0, 0 ), // S2_IN DEF_TIM(TIM8, CH1, PC6, TIM_USE_PWM, 0, 0 ), // S3_IN DMA2_ST2 DMA2_ST2 - DEF_TIM(TIM8, CH2, PC7, TIM_USE_PWM, 0, 0 ), // S4_IN DMA2_ST3 DMA2_ST2 - DEF_TIM(TIM8, CH3, PC8, TIM_USE_PWM, 0, 0 ), // S5_IN DMA2_ST4 DMA2_ST2 + DEF_TIM(TIM8, CH2, PC7, TIM_USE_PWM, 0, 1 ), // S4_IN DMA2_ST3 DMA2_ST2 + DEF_TIM(TIM8, CH3, PC8, TIM_USE_PWM, 0, 1 ), // S5_IN DMA2_ST4 DMA2_ST2 DEF_TIM(TIM8, CH4, PC9, TIM_USE_PWM, 0, 0 ), // S6_IN DMA2_ST7 DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0 ), // S10_OUT 1 DMA1_ST7 diff --git a/src/main/target/ANYFCM7/target.c b/src/main/target/ANYFCM7/target.c index a88b85c0a..06de11de1 100644 --- a/src/main/target/ANYFCM7/target.c +++ b/src/main/target/ANYFCM7/target.c @@ -31,8 +31,8 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM12, CH1, PB14, TIM_USE_PWM | TIM_USE_PPM, 0, 0 ), // S1_IN DEF_TIM(TIM12, CH2, PB15, TIM_USE_PWM, 0, 0 ), // S2_IN DEF_TIM(TIM8, CH1, PC6, TIM_USE_PWM, 0, 0 ), // S3_IN DMA2_ST2 DMA2_ST2 - DEF_TIM(TIM8, CH2, PC7, TIM_USE_PWM, 0, 0 ), // S4_IN DMA2_ST3 DMA2_ST2 - DEF_TIM(TIM8, CH3, PC8, TIM_USE_PWM, 0, 0 ), // S5_IN DMA2_ST4 DMA2_ST2 + DEF_TIM(TIM8, CH2, PC7, TIM_USE_PWM, 0, 1 ), // S4_IN DMA2_ST3 DMA2_ST2 + DEF_TIM(TIM8, CH3, PC8, TIM_USE_PWM, 0, 1 ), // S5_IN DMA2_ST4 DMA2_ST2 DEF_TIM(TIM8, CH4, PC9, TIM_USE_PWM, 0, 0 ), // S6_IN DMA2_ST7 DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0 ), // S10_OUT 1 DMA1_ST7 diff --git a/src/main/target/KISSFCV2F7/target.c b/src/main/target/KISSFCV2F7/target.c index f6a5e2557..82ca175d4 100644 --- a/src/main/target/KISSFCV2F7/target.c +++ b/src/main/target/KISSFCV2F7/target.c @@ -37,7 +37,7 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM4, CH1, PB6, TIM_USE_MOTOR, 0, 0), DEF_TIM(TIM4, CH2, PB7, TIM_USE_MOTOR, 0, 0), - DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, 0, 0), + DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, 0, 1), DEF_TIM(TIM2, CH2, PB3, TIM_USE_LED, 0, 0) diff --git a/src/main/target/MATEKF722/target.c b/src/main/target/MATEKF722/target.c index 473f66a3f..829d5117c 100644 --- a/src/main/target/MATEKF722/target.c +++ b/src/main/target/MATEKF722/target.c @@ -30,9 +30,9 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM9, CH2, PA3, TIM_USE_PPM, 0, 0), // PPM - DEF_TIM(TIM8, CH1, PC6, TIM_USE_MOTOR, 0, 0), // S1 DMA1_ST4 - DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, 0, 0), // S2 DMA2_ST3 - DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0), // S3 DMA2_ST4 + DEF_TIM(TIM8, CH1, PC6, TIM_USE_MOTOR, 0, 0), // S1 DMA2_ST2 (XXX was DMA1_ST4) + DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, 0, 1), // S2 DMA2_ST3 + DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 1), // S3 DMA2_ST4 DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0), // S4 DMA2_ST7 DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0), // S5 DMA1_ST2 diff --git a/src/main/target/NERO/target.c b/src/main/target/NERO/target.c index 32b61c4a5..dd57b89c5 100644 --- a/src/main/target/NERO/target.c +++ b/src/main/target/NERO/target.c @@ -27,14 +27,24 @@ #include "drivers/timer.h" #include "drivers/timer_def.h" +// QUAD + LED_STRIP can be handled without DMAR (dshot_burst). +// Anything beyond should use DMAR, as TIM5_CH1 and TIM3_CH4 have +// inevitable DMA collision on D(1,2). +// +// Additional DMA resource info +// ADC1 D(2,4) +// TIM5_UP U(1,0) +// TIM3_UP U(1,2) +// TIM8_UP U(2,1) + const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM3, CH2, PC7, TIM_USE_PPM, 0, 0 ), - DEF_TIM(TIM5, CH1, PA0, TIM_USE_MOTOR, 0, 0 ), - DEF_TIM(TIM5, CH2, PA1, TIM_USE_MOTOR, 0, 0 ), - DEF_TIM(TIM5, CH3, PA2, TIM_USE_MOTOR, 0, 0 ), - DEF_TIM(TIM5, CH4, PA3, TIM_USE_MOTOR, 0, 1 ), - DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR | TIM_USE_LED, 0, 0 ), - DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0 ), - DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0 ), - DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0 ), + DEF_TIM(TIM5, CH1, PA0, TIM_USE_MOTOR, 0, 0 ), // D(1,2) + DEF_TIM(TIM5, CH2, PA1, TIM_USE_MOTOR, 0, 0 ), // D(1,4) + DEF_TIM(TIM5, CH3, PA2, TIM_USE_MOTOR, 0, 0 ), // D(1,0) + DEF_TIM(TIM5, CH4, PA3, TIM_USE_MOTOR, 0, 0 ), // *D(1,1) D(1,3) + DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR | TIM_USE_LED, 0, 0 ), // D(1,7) + DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0 ), // xD(1,2) + DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0 ), // *D(2,2) D(2,4) + DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0 ), // D(2,7) }; diff --git a/src/main/target/NUCLEOF7/target.c b/src/main/target/NUCLEOF7/target.c index e7298a833..4026e59c5 100644 --- a/src/main/target/NUCLEOF7/target.c +++ b/src/main/target/NUCLEOF7/target.c @@ -33,9 +33,9 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM12, CH2, PB15, TIM_USE_PWM | TIM_USE_PPM, 0, 0), // S2_IN DEF_TIM(TIM8, CH1, PC6, TIM_USE_PWM, 0, 0), // S3_IN - DEF_TIM(TIM8, CH2, PC7, TIM_USE_PWM, 0, 0), // S4_IN + DEF_TIM(TIM8, CH2, PC7, TIM_USE_PWM, 0, 1), // S4_IN DEF_TIM(TIM8, CH4, PC9, TIM_USE_PWM, 0, 0), // S5_IN - DEF_TIM(TIM8, CH3, PC8, TIM_USE_PWM, 0, 0), // S6_IN + DEF_TIM(TIM8, CH3, PC8, TIM_USE_PWM, 0, 1), // S6_IN DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0), // S10_OUT 1 DEF_TIM(TIM2, CH4, PA3, TIM_USE_MOTOR, 0, 1), // S1_OUT 4 diff --git a/src/main/target/NUCLEOF722/target.c b/src/main/target/NUCLEOF722/target.c index 48f7a9cd4..bfe078fff 100644 --- a/src/main/target/NUCLEOF722/target.c +++ b/src/main/target/NUCLEOF722/target.c @@ -31,9 +31,9 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM12, CH2, PB15, TIM_USE_PWM | TIM_USE_PPM, 0, 0), DEF_TIM(TIM8, CH1, PC6, TIM_USE_PWM, 0, 0), - DEF_TIM(TIM8, CH2, PC7, TIM_USE_PWM, 0, 0), + DEF_TIM(TIM8, CH2, PC7, TIM_USE_PWM, 0, 1), // DEF_TIM(TIM8, CH4, PC9, TIM_USE_PWM, 0, 0), // Used for SDIO -// DEF_TIM(TIM8, CH3, PC8, TIM_USE_PWM, 0, 0), // Used for SDIO +// DEF_TIM(TIM8, CH3, PC8, TIM_USE_PWM, 0, 1), // Used for SDIO DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0), DEF_TIM(TIM2, CH4, PA3, TIM_USE_MOTOR, 0, 1), diff --git a/src/main/target/OMNIBUSF7/target.c b/src/main/target/OMNIBUSF7/target.c index fc0abf8c8..642eb73c1 100644 --- a/src/main/target/OMNIBUSF7/target.c +++ b/src/main/target/OMNIBUSF7/target.c @@ -30,7 +30,7 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { #ifdef FPVM_BETAFLIGHTF7 - DEF_TIM(TIM8, CH3, PC8, TIM_USE_CAMERA_CONTROL, 0, 0), // USED FOR CAMERA CONTROL + DEF_TIM(TIM8, CH3, PC8, TIM_USE_CAMERA_CONTROL, 0, 1), // USED FOR CAMERA CONTROL #endif DEF_TIM(TIM1, CH3, PE13, TIM_USE_NONE, 0, 1 ), // RC1 / PPM, unusable @@ -45,7 +45,7 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM2, CH3, PB10, TIM_USE_NONE, 0, 0 ), // UART3_TX, I2C2_SCL DEF_TIM(TIM2, CH4, PB11, TIM_USE_NONE, 0, 0 ), // UART3_RX, I2C2_SDA DEF_TIM(TIM8, CH1, PC6, TIM_USE_NONE, 0, 0 ), // UART6_TX - DEF_TIM(TIM8, CH2, PC7, TIM_USE_NONE, 0, 0 ), // UART6_RX + DEF_TIM(TIM8, CH2, PC7, TIM_USE_NONE, 0, 1 ), // UART6_RX DEF_TIM(TIM2, CH4, PA3, TIM_USE_PPM, 0, 0 ), // UART2_RX, joined with PE13 // For ESC serial diff --git a/src/main/target/OMNINXT/target.c b/src/main/target/OMNINXT/target.c index 77d558383..288855769 100644 --- a/src/main/target/OMNINXT/target.c +++ b/src/main/target/OMNINXT/target.c @@ -36,7 +36,7 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { // Additional motors/servos DEF_TIM(TIM8, CH4, PC9, TIM_USE_NONE, 0, 0), // MST5 Collision with TX/RX6 (useful for OCTO) - DEF_TIM(TIM8, CH3, PC8, TIM_USE_NONE, 0, 0), // MST6 Collision with TX/RX6 (useful for OCTO) + DEF_TIM(TIM8, CH3, PC8, TIM_USE_NONE, 0, 1), // MST6 Collision with TX/RX6 (useful for OCTO) DEF_TIM(TIM11, CH1, PB9, TIM_USE_NONE, 0, 0), // I2C1_SDA, MST7 DEF_TIM(TIM10, CH1, PB8, TIM_USE_NONE, 0, 0), // I2C1_SCL, MST8 @@ -62,7 +62,7 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM5, CH2, PA1, TIM_USE_NONE, 0, 0), // UART4_RX DEF_TIM(TIM8, CH1, PC6, TIM_USE_NONE, 0, 0), // UART6_TX Collision with MS1&2 (useful for OCTO) - DEF_TIM(TIM8, CH2, PC7, TIM_USE_NONE, 0, 0), // UART6_RX Collision with MS1&2 (useful for OCTO) + DEF_TIM(TIM8, CH2, PC7, TIM_USE_NONE, 0, 1), // UART6_RX Collision with MS1&2 (useful for OCTO) // Others DEF_TIM(TIM1, CH3, PA10, TIM_USE_NONE, 0, 0), // CS_ExtIMU, Collision with LED_STRIP diff --git a/src/main/target/SPRACINGF7DUAL/target.c b/src/main/target/SPRACINGF7DUAL/target.c index 50d0c27fb..8a42a8215 100644 --- a/src/main/target/SPRACINGF7DUAL/target.c +++ b/src/main/target/SPRACINGF7DUAL/target.c @@ -34,16 +34,16 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM9, CH1, PA2, TIM_USE_PWM, 0, 0), // PPM / PWM2 / UART2 TX #if (SPRACINGF7DUAL_REV <= 1) - DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, 0, 0), // ESC 1 + DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, 0, 1), // ESC 1 #else - DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0), // ESC 1 + DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 1), // ESC 1 #endif DEF_TIM(TIM8, CH1, PC6, TIM_USE_MOTOR, 0, 0), // ESC 2 DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0), // ESC 3 #if (SPRACINGF7DUAL_REV <= 1) - DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0), // ESC 4 + DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 1), // ESC 4 #else - DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, 0, 0), // ESC 4 + DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, 0, 1), // ESC 4 #endif DEF_TIM(TIM4, CH1, PB6, TIM_USE_MOTOR, 0, 0), // ESC 5 / Conflicts with USART5_RX / SPI3_RX - SPI3_RX can be mapped to DMA1_ST3_CH0 diff --git a/src/main/target/YUPIF7/target.c b/src/main/target/YUPIF7/target.c index 4322d8372..d989e3bb3 100644 --- a/src/main/target/YUPIF7/target.c +++ b/src/main/target/YUPIF7/target.c @@ -28,8 +28,8 @@ #include "drivers/timer_def.h" const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { - DEF_TIM(TIM8, CH3, PC8, TIM_USE_PPM, 0, 0 ), // PPM IN - DEF_TIM(TIM5, CH1, PA0, TIM_USE_MOTOR, 0, 0 ), // S1_OUT - DMA1_ST2 + DEF_TIM(TIM8, CH3, PC8, TIM_USE_PPM, 0, 1 ), // PPM IN + DEF_TIM(TIM2, CH1, PA0, TIM_USE_MOTOR, 0, 0 ), // S1_OUT - DMA1_ST2 DEF_TIM(TIM5, CH2, PA1, TIM_USE_MOTOR, 0, 0 ), // S2_OUT - DMA1_ST4 DEF_TIM(TIM5, CH3, PA2, TIM_USE_MOTOR, 0, 0 ), // S3_OUT - DMA1_ST1 DEF_TIM(TIM5, CH4, PA3, TIM_USE_MOTOR, 0, 1 ), // S4_OUT - DMA1_ST6