ECROS API Function OsGetEvents()

OsEventsT OsGetEvents( void );

Function OsGetEvents() may be called by the client application to get the event pattern of the task that is currently running.  It takes no arguments and returns the current event pattern of the running task.  A task can use this function to get its own events.  Although a task's events are passed to the task function as an argument, if events have been accepted in the current invocation program logic may be clearer if this API function is used to obtain a new copy.

Example

The example below shows a task function refreshing the variable events after some processing has accepted events and perhaps set others in the task.  The variable, having been passed by value to the function, cannot reflect the new event pattern in the task.  If newly set events are to be processed in the current run of the task, the current event pattern of the task can be obtained from ECROS in this way.

Note that if events set in the current run of the task are to be processed in a future run, it is not necessary refresh the event pattern.  Many task structures are possible that do not need to call OsGetEvents().


Last edited December 10, 2002.  All material Copyright © 2002 Graham Davies, ECROS Technology.