mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +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,6 +235,19 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
|
|||
#ifdef USE_DSHOT_DMAR
|
||||
/* Enable the Output compare channel */
|
||||
uint32_t channels = 0;
|
||||
if(output & TIMER_OUTPUT_N_CHANNEL) {
|
||||
switch(motor->timerHardware->channel) {
|
||||
case TIM_CHANNEL_1:
|
||||
channels = LL_TIM_CHANNEL_CH1N;
|
||||
break;
|
||||
case TIM_CHANNEL_2:
|
||||
channels = LL_TIM_CHANNEL_CH2N;
|
||||
break;
|
||||
case TIM_CHANNEL_3:
|
||||
channels = LL_TIM_CHANNEL_CH3N;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch(motor->timerHardware->channel) {
|
||||
case TIM_CHANNEL_1:
|
||||
channels = LL_TIM_CHANNEL_CH1;
|
||||
|
@ -249,6 +262,7 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m
|
|||
channels = LL_TIM_CHANNEL_CH4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
motor->timerIndex = timerIndex;
|
||||
LL_TIM_CC_EnableChannel(motor->timerHardware->tim, channels);
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue