AutosarOS
Events.c File Reference

Implementation of event management. More...

#include "Events.h"
#include "Types.h"
#include "OS.h"
#include "OCB.h"
#include "Resource.h"
#include <util/atomic.h>
Include dependency graph for Events.c:

Go to the source code of this file.

Functions

StatusType Events_SetEvent (TaskType TaskID, EventMaskType events)
 Set events. More...
 
StatusType Events_ClearEvent (EventMaskType events)
 Clear events. More...
 
StatusType Events_GetEvent (TaskType TaskID, EventMaskRefType events)
 Get events. More...
 
StatusType Events_WaitEvent (EventMaskType events)
 Wait for events. More...
 

Detailed Description

Implementation of event management.

Date
2020-05-28
Author
Pascal Romahn

Definition in file Events.c.

Function Documentation

◆ Events_ClearEvent()

StatusType Events_ClearEvent ( EventMaskType  events)

Clear events.

Clear one or several events according to the specified events mask.

Events can only be cleared by extended tasks. Tasks can only clear their own events.

Parameters
eventsMask of events to clear
Returns
E_OK No error
E_OS_ACCESS Call not from extended task
E_OS_CALLLEVEL Call at interrupt level

Definition at line 67 of file Events.c.

◆ Events_GetEvent()

StatusType Events_GetEvent ( TaskType  TaskID,
EventMaskRefType  events 
)

Get events.

Get current event state of task.

Parameters
TaskIDID of the task to request event state from
eventsPointer to write event state to
Returns
E_OK No error
E_OS_ID TaskID is invalid
E_OS_ACCESS Referenced task is not an extended task
E_OS_STATE Referenced task is in the suspended state
E_OS_PARAM_POINTER Pointer parameter is invalid

Definition at line 91 of file Events.c.

◆ Events_SetEvent()

StatusType Events_SetEvent ( TaskType  TaskID,
EventMaskType  events 
)

Set events.

Set one or several events according to the specified events mask. Other events remain unchanged.

The service may be called from an ISR or task level, but not from hook routines.

If the specified was waiting for at least one of the events specified it will be transferred to the ready state.

Parameters
TaskIDID of the task to set the events for
eventsMask of the events to set
Returns
E_OK No error
E_OS_ID TaskID is invalid
E_OS_ACCESS Referenced task is no extended task
E_OS_STATE Referenced task is in suspended state

Definition at line 22 of file Events.c.

Here is the call graph for this function:

◆ Events_WaitEvent()

StatusType Events_WaitEvent ( EventMaskType  events)

Wait for events.

Wait for events according to the specified events mask. The calling task is transferred to the waiting state unless at least one of the specified events is already pending/set.

If rescheduling takes place the internal resource of the task is released while the task is in the waiting state.

This service shall only be called from the extended task owning the events.

Parameters
eventsMask of events to wait for
Returns
E_OK No error
E_OS_ACCESS Calling task is not an extended task
E_OS_RESOURCE Calling task occupies resources E_OS_CALLLEVEL Call at interrupt level

Definition at line 127 of file Events.c.

Here is the call graph for this function: