Skip to content

Commit

Permalink
Merge pull request #927 from iNavFlight/ch-fwd-evo
Browse files Browse the repository at this point in the history
Allow channel forwarding on EVO and MINI
  • Loading branch information
digitalentity committed Dec 19, 2016
2 parents 005062f + 7da5465 commit 6b28d5f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/main/drivers/pwm_mapping.c
Expand Up @@ -267,9 +267,9 @@ pwmIOConfiguration_t *pwmInit(drv_pwm_config_t *init)
#endif

#if defined(SPRACINGF3EVO)
// remap PWM6+7 as servos
if ((timerIndex == PWM8 || timerIndex == PWM9) && timerHardwarePtr->tim == TIM3)
if ((timerIndex == PWM6 || timerIndex == PWM7 || timerIndex == PWM8 || timerIndex == PWM9) && timerHardwarePtr->tim == TIM3) {
type = MAP_TO_SERVO_OUTPUT;
}
#endif

#if (defined(STM32F3DISCOVERY) && !defined(CHEBUZZF3))
Expand Down Expand Up @@ -317,6 +317,19 @@ pwmIOConfiguration_t *pwmInit(drv_pwm_config_t *init)
if (timerIndex >= PWM5 && timerIndex <= PWM8)
type = MAP_TO_SERVO_OUTPUT;
#endif

#if defined(SPRACINGF3EVO)
if ((timerIndex == PWM6 || timerIndex == PWM7 || timerIndex == PWM8 || timerIndex == PWM9) && timerHardwarePtr->tim == TIM3) {
type = MAP_TO_SERVO_OUTPUT;
}
#endif

#if defined(SPRACINGF3MINI)
if (((timerIndex == PWM6 || timerIndex == PWM7) && timerHardwarePtr->tim == TIM15)
|| ((timerIndex == PWM8 || timerIndex == PWM9 || timerIndex == PWM10 || timerIndex == PWM11) && timerHardwarePtr->tim == TIM2)) {
type = MAP_TO_SERVO_OUTPUT;
}
#endif
}

#endif // USE_SERVOS
Expand Down

0 comments on commit 6b28d5f

Please sign in to comment.