Page 1 of 1

HAL config structures

Posted: Fri Jan 13, 2012 3:59 pm
by tinito
Hi,

I've been some troubles debugging an application, as the callback of a PWM channel was jumping pretty randomly, and finally the problem was related with my PWMConfig structure that was not a global or static variable but a local one inside mi init() funciton.
After some debugging I've noticed that the config structures are not copied but passed as pointer (as I could have guessed by I did not).

Giovanni, maybe adding a note in the HAL documentation that explicitly says to declare those structures as global or static can be useful to avoid writing wrong code as I did.

Re: HAL config structures

Posted: Fri Jan 13, 2012 4:11 pm
by Giovanni
Good idea.

Giovanni