PxPeRelease()

Release the periodic event object.

APPLIES TO

1.0.0

SYNOPSIS
PxPe_t PxPeRelease (PxPe_t Pe);
ARGUMENTS
Pe

Periodic event handler object

RETURN VALUES
  • Invalid periodic event object on success

  • Periodic event object on failure

ERROR CODES

PXERR_PE_ILLPE

Pe is not a valid periodic event handler object

PXERR_GLOBAL_ILLEGAL_CORE

The requested object pool is not on the same core

PXERR_DELAY_USED_BY_INTERRUPT

Delay object currently in use by the interrupt handler

PXERR_OPOOL_ILLOPOOL

The object pool is not valid

PXERR_TASK_ILLTASK

The task is not a valid task object

PXERR_INTERNAL_INCONSISTENCY

Inconsistency of internal structures

DESCRIPTION

PxPeRelease stops the periodic event object Pe (if necessary) and releases the associated resources (allocated by PxPeRequest). After this call, Pe may not be used.

IMPLEMENTATION GUIDELINES
Before call
  • Pe must be a valid PXROS-HR periodic event object created with a PxPeRequest call (V). The validity of Pe may also be checked by the PxPeIsValid macro (F).

After call
  • PxPeRelease returns the periodic event object to the object pool it has been taken from. On success PxPeRelease returns the invalidated periodic event object. This may be checked with one of the following macros:

    • PxPeIdIsValid() must be false.

    • PxPeIdGet() must be _PXIllegalObjId.

    • PxPeIdError() must be PXERR_NOERROR otherwise the returned error code has to be interpreted (C).

Best Practice
  • After PxPeRelease, the given periodic event object Pe is no longer valid and may never be used as periodic event object!

SEE ALSO
USAGE
#include "pxdef.h"

PxPe_t Pe = PxPeRelease(Pe);

if (PxPeIdError(Pe) == PXERR_NOERROR) {
  // Report error
}