encoding GPIO ports

Discussions and support about ChibiOS/RT, the free embedded RTOS.
User avatar
wurstnase
Posts: 121
Joined: Tue Oct 17, 2017 2:24 pm
Has thanked: 43 times
Been thanked: 30 times

Re: encoding GPIO ports

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

Re: encoding GPIO ports

Post 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
Post Reply