AutosarOS
|
Implementation of event management. More...
#include "Events.h"
#include "Types.h"
#include "OS.h"
#include "OCB.h"
#include "Resource.h"
#include <util/atomic.h>
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... | |
Implementation of event management.
Definition in file Events.c.
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.
events | Mask of events to clear |
StatusType Events_GetEvent | ( | TaskType | TaskID, |
EventMaskRefType | events | ||
) |
Get events.
Get current event state of task.
TaskID | ID of the task to request event state from |
events | Pointer to write event state to |
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.
TaskID | ID of the task to set the events for |
events | Mask of the events to set |
Definition at line 22 of file Events.c.
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.
events | Mask of events to wait for |
Definition at line 127 of file Events.c.