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.
HAL config structures
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times