Skip to content

Commit

Permalink
[stm32] actuators_pwm: fix for LisaL
Browse files Browse the repository at this point in the history
Thanks to tommy.detoisien for finding this fix.
  • Loading branch information
flixr committed Jun 20, 2014
1 parent 7a23461 commit c524d19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Expand Up @@ -75,18 +75,18 @@ void actuators_dualpwm_arch_init(void) {
/*----------------
* Configure GPIO
*----------------*/
#if defined(STM32F1)
/* TIM3 GPIO for PWM1..4 */
AFIO_MAPR |= AFIO_MAPR_TIM3_REMAP_FULL_REMAP;
#endif

#ifdef DUAL_PWM_SERVO_5
set_servo_gpio(DUAL_PWM_SERVO_5_GPIO, DUAL_PWM_SERVO_5_PIN, DUAL_PWM_SERVO_5_AF, DUAL_PWM_SERVO_5_RCC);
#endif
#ifdef DUAL_PWM_SERVO_6
set_servo_gpio(DUAL_PWM_SERVO_6_GPIO, DUAL_PWM_SERVO_6_PIN, DUAL_PWM_SERVO_6_AF, DUAL_PWM_SERVO_6_RCC);
#endif

#if defined(STM32F1) && PWM_USE_TIM3
/* TIM3 GPIO for PWM1..4 */
AFIO_MAPR |= AFIO_MAPR_TIM3_REMAP_FULL_REMAP;
#endif

#if DUAL_PWM_USE_TIM5
set_servo_timer(TIM5, TIM5_SERVO_HZ, PWM_TIM5_CHAN_MASK);

Expand Down
Expand Up @@ -72,11 +72,6 @@ void actuators_pwm_arch_init(void) {
/*----------------
* Configure GPIO
*----------------*/
#if defined(STM32F1)
/* TIM3 GPIO for PWM1..4 */
AFIO_MAPR |= AFIO_MAPR_TIM3_REMAP_FULL_REMAP;
#endif

#ifdef PWM_SERVO_0
set_servo_gpio(PWM_SERVO_0_GPIO, PWM_SERVO_0_PIN, PWM_SERVO_0_AF, PWM_SERVO_0_RCC);
#endif
Expand Down Expand Up @@ -114,6 +109,10 @@ void actuators_pwm_arch_init(void) {
set_servo_gpio(PWM_SERVO_11_GPIO, PWM_SERVO_11_PIN, PWM_SERVO_11_AF, PWM_SERVO_11_RCC);
#endif

#if defined(STM32F1) && PWM_USE_TIM3
/* TIM3 GPIO for PWM1..4 */
AFIO_MAPR |= AFIO_MAPR_TIM3_REMAP_FULL_REMAP;
#endif

#if PWM_USE_TIM1
set_servo_timer(TIM1, TIM1_SERVO_HZ, PWM_TIM1_CHAN_MASK);
Expand Down

0 comments on commit c524d19

Please sign in to comment.