[DONE] STM32F103 PWM driver

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
kalevik
Posts: 3
Joined: Wed Dec 21, 2011 1:15 pm

[DONE] STM32F103 PWM driver

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F103 PWM driver

Post by Giovanni »

Hi,

This is definitely a subtle bug, thanks for finding.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [TODO] STM32F103 PWM driver

Post by Giovanni »

Fixed in repository.

Giovanni
Post Reply