[DONE] Dynamic PWM channel configuration?

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

Moderator: RoccoMarco

goeck
Posts: 92
Joined: Mon Feb 11, 2013 12:00 pm

Re: [DONE] Dynamic PWM channel configuration?

Post by goeck »

Awesome work, Giovanni!

There's one thing though I came across just now, using the new API.
I found that the pointer to the PWMDriver object is not good (compiler error), and looked into the code again.
According to other macros, pwmp has to be put in bracktes to be used as pointer, then it workes like a charm. So here is the replacement:

Code: Select all

#define pwm_lld_is_channel_enabled(pwmp, channel)                           \
  (((pwmp)->tim->CCR[channel] != 0) ||                                        \
   (((pwmp)->tim->DIER & (2 << channel)) != 0))

Hope this helps.

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

Re: [DONE] Dynamic PWM channel configuration?

Post by Giovanni »

Hi,

Thanks for fixing, I didn't notice it, committed in trunk.

Giovanni
Post Reply