PxTaskSignalEvents_Hnd()

Signal events to a task (handler service).

APPLIES TO

8.2.0

SYNOPSIS
PxError_t PxTaskSignalEvents_Hnd (PxTask_t TaskId, PxEvents_t events);
ARGUMENTS
TaskId

Task to send the events to

events

Events to send

RETURN VALUES
  • PXROS error code

ERROR CODES

PXERR_GLOBAL_ILLEGAL_CORE

the requested task is not on the same core

PXERR_TASK_ILLTASK

TaskId is not a valid task object

DESCRIPTION

PxTaskSignalEvents_Hnd signals the events specified in events to TaskId. There they are saved until handled by task.

If TaskId waits for any of the events (with a PxAwaitEvents call or a call with the _EvWait suffix), the task is readied and the service returns. If some of the task’s aborting events occur (see PxExpectAbort) and task’s abort mechanism is enabled, the PxExpectAbort call returns prematurely. If the events are signaled to a task on an other core, PXROS will allocate an object for intercore communication to send this request to the other core for execution.

PxTaskSignalEvents_Hnd is the handler service. The handler service can not send events to tasks on other cores because it can not allocate an object for the request intercore communication.

IMPLEMENTATION GUIDELINES
Before call
  • The parameter TaskId must be a valid task object.

After call
  • The function returns PXERR_NOERROR if the event could be signaled to the task. Any other return value describes an error, which has to be interpreted. (C)

Best Practice
  • This function should be called from handlers only. (V)

SEE ALSO
USAGE
#include "pxdef.h"

#define MY_EVENT 0x1l

PxError_t Err = PxTaskSignalEvents_Hnd(TaskId, MY_EVENT);

if (Err != PXERR_NOERROR) {
    // Report error
}