Page 1 of 1

Understanding events

Posted: Tue Jun 12, 2012 2:54 am
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

Re: Understanding events

Posted: Tue Jun 12, 2012 6:13 am
by Tectu
In my opinion: yes

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



~ Tectu

Re: Understanding events

Posted: Tue Jun 12, 2012 7:18 am
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