Page 1 of 1

[DONE] STM32F103 PWM driver

Posted: Fri May 03, 2013 7:24 pm
by kalevik
Compiler:
arm-none-eabi-gcc (Sourcery G++ Lite 2010q1-188) 4.4.1

Chibios 2.4.3.

When i use command (definition) pwmChangePeriodI(&PWMD3, new_period_value) i got compiler error 'PWMDriver' has no member named 'new_period_value'.

In file /ChibiOS_2.4.3/os/hal/include/pwm.h (line 183) is definition:

Code: Select all

#define pwmChangePeriodI(pwmp, period) {                                    \
  (pwmp)->period = (period);                                                \
  pwm_lld_change_period(pwmp, period);                                      \
}


Is this really as it's should be?

I change definition to:

Code: Select all

#define pwmChangePeriodI(pwmp, value) {                                    \
  (pwmp)->period = (value);                                                \
  pwm_lld_change_period(pwmp, value);                                      \
}


and everything works fine.

kalevik

Re: STM32F103 PWM driver

Posted: Fri May 03, 2013 7:35 pm
by Giovanni
Hi,

This is definitely a subtle bug, thanks for finding.

Giovanni

Re: [TODO] STM32F103 PWM driver

Posted: Sat May 04, 2013 8:49 am
by Giovanni
Fixed in repository.

Giovanni