PxSysInfoGetDelayInfo()

Function to get delay info.

APPLIES TO

1.0.0

SYNOPSIS
PxError_t PxSysInfoGetDelayInfo (PxInfoDelay_t *DelayInfo, PxDelay_t delayId);
ARGUMENTS
DelayInfo

Pointer to data area to store delay information to

delayId

Id of delay object

RETURN VALUES
  • PXROS error code

ERROR CODES

PXERR_DELAY_ILLDELAY

The given object is no delay object

PXERR_PROT_PERMISSION

The task has no write permission on the DelayInfo object

DESCRIPTION

PxSysInfoGetDelayInfo stores the contents of the delay structure delayId into the info structure DelayInfo. The structure DelayInfo has the following format:

typedef struct
{
	PxInfoDelayType_t PxInfoDelay_Type; // delay type
	void      (*PxInfoDelay_Handler) (PxArg_t); // delay handler function
	PxULong_t PxInfoDelay_Param; // delay handler function’s arguments
	PxULong_t PxInfoDelay_Ticks; // delay ticks
	PxULong_t PxInfoDelay_RestTicks; // delay rest ticks
	PxTask_t  PxInfoDelay_RequestingTask; // task which requested the delay object
} PxInfoDelay_t;

The delay objectdelayId may have one of the following types:

typedef enum
{
	DelayType_InUse,
	DelayType_NotUsed
} PxInfoDelayType_t;

There is a union available containing all sysinfo types:

typedef union
{
	PxInfoMC_t  McInfo; // memory class information struct
	PxInfoOpool_t  OpoolInfo; // Opool information struct
	PxInfoMsg_t  MsgInfo; // message information struct
	PxInfoMbx_t  MbxInfo; // mailbox information struct
	PxInfoDelay_t  DelayInfo; // delay object information struct
	PxInfoPe_t  PeInfo; // periodic event information struct
	PxInfoTo_t  ToInfo; // timeout object information struct
	PxInfoInterrupt_t  InterruptInfo; // interrupt object information struct
} PxObjInfo_T;
IMPLEMENTATION GUIDELINES
Before call
  • DelayInfo must be a pointer to a valid data area.

  • delayId must be a valid PXROS-HR delay object created with a PxDelayRequest call (V). The validity of delayId may also be checked by the PxDelayIsValid macro (F). The delay object must be created on the same core as the caller runs on. The creator core id can be read with the macro PxDelayCoreId and the own core id with PxGetCoreId (C).

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

Best Practice
  • No restrictions

SEE ALSO
USAGE
#include "pxdef.h"

PxError_t err = PxSysInfoGetDelayInfo(&DelayInfo, delayId);

if (err == PXERR_NOERROR) {
    // Handle info
}
else {
    // Report error
}