mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +03:00
Merge pull request #4664 from sambas/betaflightF7
Fix F7 DMAR N-channel output init
This commit is contained in:
commit
0d89fce800
1 changed files with 27 additions and 13 deletions
|
@ -235,19 +235,33 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
|
||||||
#ifdef USE_DSHOT_DMAR
|
#ifdef USE_DSHOT_DMAR
|
||||||
/* Enable the Output compare channel */
|
/* Enable the Output compare channel */
|
||||||
uint32_t channels = 0;
|
uint32_t channels = 0;
|
||||||
switch(motor->timerHardware->channel) {
|
if(output & TIMER_OUTPUT_N_CHANNEL) {
|
||||||
case TIM_CHANNEL_1:
|
switch(motor->timerHardware->channel) {
|
||||||
channels = LL_TIM_CHANNEL_CH1;
|
case TIM_CHANNEL_1:
|
||||||
break;
|
channels = LL_TIM_CHANNEL_CH1N;
|
||||||
case TIM_CHANNEL_2:
|
break;
|
||||||
channels = LL_TIM_CHANNEL_CH2;
|
case TIM_CHANNEL_2:
|
||||||
break;
|
channels = LL_TIM_CHANNEL_CH2N;
|
||||||
case TIM_CHANNEL_3:
|
break;
|
||||||
channels = LL_TIM_CHANNEL_CH3;
|
case TIM_CHANNEL_3:
|
||||||
break;
|
channels = LL_TIM_CHANNEL_CH3N;
|
||||||
case TIM_CHANNEL_4:
|
break;
|
||||||
channels = LL_TIM_CHANNEL_CH4;
|
}
|
||||||
break;
|
} else {
|
||||||
|
switch(motor->timerHardware->channel) {
|
||||||
|
case TIM_CHANNEL_1:
|
||||||
|
channels = LL_TIM_CHANNEL_CH1;
|
||||||
|
break;
|
||||||
|
case TIM_CHANNEL_2:
|
||||||
|
channels = LL_TIM_CHANNEL_CH2;
|
||||||
|
break;
|
||||||
|
case TIM_CHANNEL_3:
|
||||||
|
channels = LL_TIM_CHANNEL_CH3;
|
||||||
|
break;
|
||||||
|
case TIM_CHANNEL_4:
|
||||||
|
channels = LL_TIM_CHANNEL_CH4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
motor->timerIndex = timerIndex;
|
motor->timerIndex = timerIndex;
|
||||||
LL_TIM_CC_EnableChannel(motor->timerHardware->tim, channels);
|
LL_TIM_CC_EnableChannel(motor->timerHardware->tim, channels);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue