Understanding events

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

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
trunet
Posts: 54
Joined: Fri Apr 06, 2012 7:18 pm

Understanding events

Post by trunet »

Hi,

I'm trying to use events on my project however I have some questions regarding event_mask.

If I have 4 event_mask(0, 1, 2 and 3) and I want to wait for two of them(0 and 1), is this the right way to do it?

Code: Select all

chEvtWaitAll(EVENT_MASK(0) & EVENT_MASK(1));


Thanks,

Wagner Sartori Junior
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Understanding events

Post by Tectu »

In my opinion: yes

But I'd suggest that you wait until Giovanni or someone else knowing more about that answers.



~ Tectu
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Understanding events

Post by Giovanni »

Yes, it is the right way. You use the events mask when the thread is registered on multiple sources but you want to wait for a specific set (AND or OR depending on the "wait" function used).

Giovanni
Post Reply