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
Contact:

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
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

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

Giovanni


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 35 guests