📄 rzkgeteventgroupparameters.c
字号:
/*
* File : RZKGetEventGroupParameters.c
*
* Description : This file defines an API to get event group parameters.
*
* Copyright 2004 ZiLOG Inc. ALL RIGHTS RESERVED.
*
* This file contains unpublished confidential and proprietary information
* of ZiLOG, Inc.
* NO PART OF THIS WORK MAY BE DUPLICATED, STORED, PUBLISHED OR DISCLOSED
* IN ANY FORM WITHOUT THE PRIOR WRITTEN CONSENT OF ZiLOG, INC.
* This is not a license and no use of any kind of this work is authorized
* in the absence of a written license granted by ZiLOG, Inc. in ZiLOG's
* sole discretion
*/
#include "ZSysgen.h"
#include "ZTypes.h"
#include "ZThread.h"
#include "ZEventgroup.h"
#include "externvar.h"
#define pCurrentThread ((RZK_TCB_t *) hCurrentThread)
#define pEventGroup ((RZK_EVENTGROUP_t *) hEventGroup)
/** extern variables */
/* Function : RZKGetEventGroupParameters
*
* Description : Get the parameters from event group
* control block to the user specified event
* group params structure.
*
* Inputs : hEventGroup - handle to the event group.
* *pEventGroupParams - pointer to the event group parameter structure
*
* Outputs : RZKERR_SUCCESS - If the specified parameters are successfully retrieved.
* RZKERR_INVALID_HANDLE - if the specified handle was invalid.
* RZKERR_INVALID_ARGUMENTS - if the specified address of the structure was NULL.
* RZKERR_CB_BUSY - specifies the object is for exclusive use
*
* Dependencies : hCurrentThread
*/
RZK_STATUS_t RZKGetEventGroupParameters
(
RZK_EVENTHANDLE_t hEventGroup,
RZK_EVENTGROUPPARAMS_t *pEventGroupParams
)
{
/*Validate the event group parameter*/
#ifdef RZK_DEBUG
if (pEventGroupParams == NULL )
return RZKERR_INVALID_ARGUMENTS;
#endif
/* If the EventGroup handle is NULL then retrieve the uMask of the TCB's structure to pEventGroupParams structure */
#ifdef RZK_DEBUG /* Check for INVALID_HANDLE */
if (pEventGroup == NULL || pEventGroup -> uState == 0 ||
pEventGroup -> magic_num != MAGIC_NUM_EVENT)
return RZKERR_INVALID_HANDLE;
#endif
/* If the uState is set to object created state then return
control block busy status */
#ifndef RZK_PERFORMANCE
if(!(pEventGroup -> uState & OBJECT_CREATED))
return RZKERR_CB_BUSY;
#endif
pEventGroupParams -> eEventsReceived = pEventGroup -> eEventsReceived;
return RZKERR_SUCCESS;
} /* End of RZKGetEventGroupParameters */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -