HAL config structures

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
tinito
Posts: 112
Joined: Tue Jun 07, 2011 10:32 am
Has thanked: 1 time
Been thanked: 1 time

HAL config structures

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

Re: HAL config structures

Post by Giovanni »

Good idea.

Giovanni
Post Reply