[DONE] Interested only at specific flags in a Event [patch]

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
sam0737
Posts: 4
Joined: Sun Apr 14, 2013 4:47 am

[DONE] Interested only at specific flags in a Event [patch]

Post by sam0737 »

I am on 2.5.2.
I am using chEvtWaitAnyTimeout to wait for serial event and some other application events. For the serial, I am only interested at CHN_CONNECTED | CHN_INPUT_AVAILABLE. I don't want the thread to be waken up by the CHN_OUTPUT_EMPTY.
The problem is exaggerated when combined with Win32's serial_lld.c, because it is polling the queue and raising the event for every tick.

Hence I suggest adding a chEvtRegisterMaskWithFlags(), so application can wait for specific flags it is interested at.

Patch
https://github.com/sam0737/chibios-rt-a ... 765824d33f
https://github.com/sam0737/chibios-rt-a ... b6d0385873
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Interested only at specific flags in a Event [patch]

Post by Giovanni »

Hi,

It is a good idea, it could be eventually added to version 3.0.0. Adding to the TODO.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [TODO] Interested only at specific flags in a Event [pat

Post by Giovanni »

Hi,

A bit late but the change has been merged in 3.0, thanks for the idea.

Giovanni
Post Reply