encoding GPIO ports

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

Re: encoding GPIO ports

Postby wurstnase » Fri Nov 15, 2019 9:29 pm

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?
\o/ Nico

User avatar
Site Admin
Posts: 13012
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 745 times
Been thanked: 621 times

Re: encoding GPIO ports

Postby Giovanni » Fri Nov 15, 2019 9:38 pm

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".


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 1 guest