FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2008 Threads] How to synchronize with multiple events ?Posted by Guy C on April 3, 2008 Hi,
How do I put a task to sleep and wake up on the appearance of several events, or on the appearance of the first event is, or on the appearance of all the events?
RE: How to synchronize with multiple events ?Posted by Dave on April 3, 2008 The best method is to have the task block on a queue, then have the data that is sent to the queue identify the event that was sent. Example give,
struct x { int Event; int Data; }
void task( void *pv ) { struct x rxData;
while(1) { xQueueReceive( Queue, &rxData, portMAX_DELAY ); switch(rxData.Event) { case COMPORT : HandleComData( rdData.Data ); break; case SSI : HandleSSIData( rxData.Data ); break; default : HandleUnknownEvent( rxData.Event, rxData.Data ); break; } } }
RE: How to synchronize with multiple events ?Posted by Guy C on April 3, 2008 Nice ! Thanks ;)
But if we want all the events raised to wake up ?
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|