Page 2 of 2
Re: encoding GPIO ports
Posted: Fri Nov 15, 2019 9:29 pm
by wurstnase
Giovanni wrote:Just a detail, you can map multiple event sources to the same eventmask_t bit. Your handler can then poll the various listeners for available flags. RAM usage is true.
I can't follow you with this completely. Do you have a minimal example, please?
Re: encoding GPIO ports
Posted: Fri Nov 15, 2019 9:38 pm
by Giovanni
It is "simple".
You can register multiple event sources to the same event bit calling chEvtRegisterMask() with "events" set to the same mask, when you get the event then you need to determine which source actually caused it, this is done by calling chEvtGetAndClearFlags() on each the event listener and see where there are flags to be "consumed".
Giovanni