2008-12-19 19:41:57 +00:00
|
|
|
|
/****************************************************************************
|
|
|
|
|
|
|
|
|
|
(c) SYSTEC electronic GmbH, D-07973 Greiz, August-Bebel-Str. 29
|
|
|
|
|
www.systec-electronic.com
|
|
|
|
|
|
|
|
|
|
Project: openPOWERLINK
|
|
|
|
|
|
|
|
|
|
Description: definitions for generating instances
|
|
|
|
|
|
|
|
|
|
License:
|
|
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
|
modification, are permitted provided that the following conditions
|
|
|
|
|
are met:
|
|
|
|
|
|
|
|
|
|
1. Redistributions of source code must retain the above copyright
|
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
|
|
|
|
|
|
2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
documentation and/or other materials provided with the distribution.
|
|
|
|
|
|
|
|
|
|
3. Neither the name of SYSTEC electronic GmbH nor the names of its
|
|
|
|
|
contributors may be used to endorse or promote products derived
|
|
|
|
|
from this software without prior written permission. For written
|
|
|
|
|
permission, please contact info@systec-electronic.com.
|
|
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
|
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
|
COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
|
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
|
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
|
POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
|
|
Severability Clause:
|
|
|
|
|
|
|
|
|
|
If a provision of this License is or becomes illegal, invalid or
|
|
|
|
|
unenforceable in any jurisdiction, that shall not affect:
|
|
|
|
|
1. the validity or enforceability in that jurisdiction of any other
|
|
|
|
|
provision of this License; or
|
|
|
|
|
2. the validity or enforceability in other jurisdictions of that or
|
|
|
|
|
any other provision of this License.
|
|
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
$RCSfile: EplInstDef.h,v $
|
|
|
|
|
|
|
|
|
|
$Author: D.Krueger $
|
|
|
|
|
|
|
|
|
|
$Revision: 1.4 $ $Date: 2008/04/17 21:36:32 $
|
|
|
|
|
|
|
|
|
|
$State: Exp $
|
|
|
|
|
|
|
|
|
|
Build Environment:
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
Revision History:
|
|
|
|
|
|
|
|
|
|
r.d.: first implementation
|
|
|
|
|
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef _EPLINSTDEF_H_
|
|
|
|
|
#define _EPLINSTDEF_H_
|
|
|
|
|
|
|
|
|
|
// =========================================================================
|
|
|
|
|
// types and macros for generating instances
|
|
|
|
|
// =========================================================================
|
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
typedef enum {
|
|
|
|
|
kStateUnused = 0,
|
|
|
|
|
kStateDeleted = 1,
|
|
|
|
|
kStateUsed = 0xFF
|
2008-12-19 19:41:57 +00:00
|
|
|
|
} tInstState;
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------
|
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
typedef void MEM *tEplPtrInstance;
|
|
|
|
|
typedef BYTE tEplInstanceHdl;
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// define const for illegale values
|
|
|
|
|
#define CCM_ILLINSTANCE NULL
|
|
|
|
|
#define CCM_ILLINSTANCE_HDL 0xFF
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------
|
|
|
|
|
// if more than one instance then use this macros
|
|
|
|
|
#if (EPL_MAX_INSTANCES > 1)
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
// macro definition for instance table definition
|
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// memory attributes for instance table
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define INST_NEAR // faster access to variables
|
|
|
|
|
#define INST_FAR // variables wich have to located in xdata
|
|
|
|
|
#define STATIC // prevent warnings for variables with same name
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define INSTANCE_TYPE_BEGIN typedef struct {
|
|
|
|
|
#define INSTANCE_TYPE_END } tEplInstanceInfo;
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
// macro definition for API interface
|
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// declaration:
|
|
|
|
|
|
|
|
|
|
// macros for declaration within function header or prototype of API functions
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_DECL_INSTANCE_HDL tEplInstanceHdl InstanceHandle
|
|
|
|
|
#define CCM_DECL_INSTANCE_HDL_ tEplInstanceHdl InstanceHandle,
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for declaration of pointer to instance handle within function header or prototype of API functions
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_DECL_PTR_INSTANCE_HDL tEplInstanceHdl MEM* pInstanceHandle
|
|
|
|
|
#define CCM_DECL_PTR_INSTANCE_HDL_ tEplInstanceHdl MEM* pInstanceHandle,
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for declaration instance as lokacl variable within functions
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_DECL_INSTANCE_PTR_LOCAL tCcmInstanceInfo MEM* pInstance;
|
|
|
|
|
#define CCM_DECL_PTR_INSTANCE_HDL_LOCAL tEplInstanceHdl MEM* pInstanceHandle;
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// reference:
|
|
|
|
|
|
|
|
|
|
// macros for reference of instance handle for function parameters
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_INSTANCE_HDL InstanceHandle
|
|
|
|
|
#define CCM_INSTANCE_HDL_ InstanceHandle,
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for reference of instance parameter for function parameters
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_INSTANCE_PARAM(par) par
|
|
|
|
|
#define CCM_INSTANCE_PARAM_(par) par,
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for reference of instance parameter for writing or reading values
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_INST_ENTRY (*((tEplPtrInstance)pInstance))
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// processing:
|
|
|
|
|
|
|
|
|
|
// macros for process instance handle
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_CHECK_INSTANCE_HDL() if (InstanceHandle >= EPL_MAX_INSTANCES) \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
{return (kEplIllegalInstance);}
|
|
|
|
|
|
|
|
|
|
// macros for process pointer to instance handle
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_CHECK_PTR_INSTANCE_HDL() if (pInstanceHandle == NULL) \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
{return (kEplInvalidInstanceParam);}
|
|
|
|
|
|
|
|
|
|
// This macro returned the handle and pointer to next free instance.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_GET_FREE_INSTANCE_AND_HDL() pInstance = CcmGetFreeInstanceAndHandle (pInstanceHandle); \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
ASSERT (*pInstanceHandle != CCM_ILLINSTANCE_HDL);
|
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_CHECK_INSTANCE_PTR() if (pInstance == CCM_ILLINSTANCE) \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
{return (kEplNoFreeInstance);}
|
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_GET_INSTANCE_PTR() pInstance = CcmGetInstancePtr (InstanceHandle);
|
|
|
|
|
#define CCM_GET_FREE_INSTANCE_PTR() pInstance = GetFreeInstance (); \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
ASSERT (pInstance != CCM_ILLINSTANCE);
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
// macro definition for stack interface
|
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// macros for declaration within the function header, prototype or local var list
|
|
|
|
|
// Declaration of pointers within function paramater list must defined as void MEM*
|
|
|
|
|
// pointer.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_PTR void MEM* pInstance
|
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_PTR_ void MEM* pInstance,
|
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_PTR_LOCAL tEplPtrInstance pInstance;
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for reference of pointer to instance
|
|
|
|
|
// These macros are used for parameter passing to called function.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_INSTANCE_PTR pInstance
|
|
|
|
|
#define EPL_MCO_INSTANCE_PTR_ pInstance,
|
|
|
|
|
#define EPL_MCO_ADDR_INSTANCE_PTR_ &pInstance,
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macro for access of struct members of one instance
|
|
|
|
|
// An access to a member of instance table must be casted by the local
|
|
|
|
|
// defined type of instance table.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_INST_ENTRY (*(tEplPtrInstance)pInstance)
|
|
|
|
|
#define EPL_MCO_GLB_VAR(var) (((tEplPtrInstance)pInstance)->var)
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for process pointer to instance
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_GET_INSTANCE_PTR() pInstance = (tEplPtrInstance) GetInstancePtr (InstanceHandle);
|
|
|
|
|
#define EPL_MCO_GET_FREE_INSTANCE_PTR() pInstance = (tEplPtrInstance) GetFreeInstance (); \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
ASSERT (pInstance != CCM_ILLINSTANCE);
|
|
|
|
|
|
|
|
|
|
// This macro should be used to check the passed pointer to an public function
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_CHECK_INSTANCE_STATE() ASSERT (pInstance != NULL); \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
ASSERT (((tEplPtrInstance)pInstance)->m_InstState == kStateUsed);
|
|
|
|
|
|
|
|
|
|
// macros for declaration of pointer to instance pointer
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DECL_PTR_INSTANCE_PTR void MEM* MEM* pInstancePtr
|
|
|
|
|
#define EPL_MCO_DECL_PTR_INSTANCE_PTR_ void MEM* MEM* pInstancePtr,
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for reference of pointer to instance pointer
|
|
|
|
|
// These macros are used for parameter passing to called function.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_PTR_INSTANCE_PTR pInstancePtr
|
|
|
|
|
#define EPL_MCO_PTR_INSTANCE_PTR_ pInstancePtr,
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for process pointer to instance pointer
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_CHECK_PTR_INSTANCE_PTR() ASSERT (pInstancePtr != NULL);
|
|
|
|
|
#define EPL_MCO_SET_PTR_INSTANCE_PTR() (*pInstancePtr = pInstance);
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_INSTANCE_PARAM(a) (a)
|
|
|
|
|
#define EPL_MCO_INSTANCE_PARAM_(a) (a),
|
|
|
|
|
#define EPL_MCO_INSTANCE_PARAM_IDX_() EPL_MCO_INSTANCE_PARAM_ (EPL_MCO_GLB_VAR (m_bInstIndex))
|
|
|
|
|
#define EPL_MCO_INSTANCE_PARAM_IDX() EPL_MCO_INSTANCE_PARAM (EPL_MCO_GLB_VAR (m_bInstIndex))
|
|
|
|
|
#define EPL_MCO_WRITE_INSTANCE_STATE(a) EPL_MCO_GLB_VAR (m_InstState) = a;
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// this macro deletes all instance entries as unused
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DELETE_INSTANCE_TABLE() \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
{ \
|
|
|
|
|
tEplInstanceInfo MEM* pInstance = &aEplInstanceTable_g[0]; \
|
|
|
|
|
tFastByte InstNumber = 0; \
|
|
|
|
|
tFastByte i = EPL_MAX_INSTANCES; \
|
|
|
|
|
do { \
|
|
|
|
|
pInstance->m_InstState = (BYTE) kStateUnused; \
|
|
|
|
|
pInstance->m_bInstIndex = (BYTE) InstNumber; \
|
|
|
|
|
pInstance++; InstNumber++; i--; \
|
|
|
|
|
} while (i != 0); \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// definition of functions which has to be defined in each module of CANopen stack
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DEFINE_INSTANCE_FCT() \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
static tEplPtrInstance GetInstancePtr (tEplInstanceHdl InstHandle_p); \
|
|
|
|
|
static tEplPtrInstance GetFreeInstance (void);
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_FCT() \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
static tEplPtrInstance GetInstancePtr (tEplInstanceHdl InstHandle_p) { \
|
|
|
|
|
return &aEplInstanceTable_g[InstHandle_p]; } \
|
|
|
|
|
static tEplPtrInstance GetFreeInstance (void) { \
|
|
|
|
|
tEplInstanceInfo MEM* pInstance = &aEplInstanceTable_g[0]; \
|
|
|
|
|
tFastByte i = EPL_MAX_INSTANCES; \
|
|
|
|
|
do { if (pInstance->m_InstState != kStateUsed) { \
|
|
|
|
|
return (tEplPtrInstance) pInstance; } \
|
|
|
|
|
pInstance++; i--; } \
|
|
|
|
|
while (i != 0); \
|
|
|
|
|
return CCM_ILLINSTANCE; }
|
|
|
|
|
|
|
|
|
|
// this macro defines the instance table. Each entry is reserved for an instance of CANopen.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_VAR() \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
static tEplInstanceInfo MEM aEplInstanceTable_g [EPL_MAX_INSTANCES];
|
|
|
|
|
|
|
|
|
|
// this macro defines member variables in instance table which are needed in
|
|
|
|
|
// all modules of Epl stack
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_MEMBER() \
|
2008-12-19 19:41:57 +00:00
|
|
|
|
STATIC BYTE m_InstState; \
|
|
|
|
|
STATIC BYTE m_bInstIndex;
|
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_INSTANCE_PARAM_IDX_() EPL_MCO_INSTANCE_PARAM_ (EPL_MCO_GLB_VAR (m_bInstIndex))
|
|
|
|
|
#define EPL_MCO_INSTANCE_PARAM_IDX() EPL_MCO_INSTANCE_PARAM (EPL_MCO_GLB_VAR (m_bInstIndex))
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#else // only one instance is used
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// Memory attributes for instance table.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define INST_NEAR NEAR // faster access to variables
|
|
|
|
|
#define INST_FAR MEM // variables wich have to located in xdata
|
|
|
|
|
#define STATIC static // prevent warnings for variables with same name
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define INSTANCE_TYPE_BEGIN
|
|
|
|
|
#define INSTANCE_TYPE_END
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for declaration, initializing and member access for instance handle
|
|
|
|
|
// This class of macros are used by API function to inform CCM-modul which
|
|
|
|
|
// instance is to be used.
|
|
|
|
|
|
|
|
|
|
// macros for reference of instance handle
|
|
|
|
|
// These macros are used for parameter passing to CANopen API function.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_INSTANCE_HDL
|
|
|
|
|
#define CCM_INSTANCE_HDL_
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_DECL_INSTANCE_PTR_LOCAL
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for declaration within the function header or prototype
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_DECL_INSTANCE_HDL void
|
|
|
|
|
#define CCM_DECL_INSTANCE_HDL_
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for process instance handle
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_CHECK_INSTANCE_HDL()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for declaration of pointer to instance handle
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_DECL_PTR_INSTANCE_HDL void
|
|
|
|
|
#define CCM_DECL_PTR_INSTANCE_HDL_
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for process pointer to instance handle
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_CHECK_PTR_INSTANCE_HDL()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// This macro returned the handle and pointer to next free instance.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_GET_FREE_INSTANCE_AND_HDL()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_CHECK_INSTANCE_PTR()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_GET_INSTANCE_PTR()
|
|
|
|
|
#define CCM_GET_FREE_INSTANCE_PTR()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_INSTANCE_PARAM(par)
|
|
|
|
|
#define CCM_INSTANCE_PARAM_(par)
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define CCM_INST_ENTRY aCcmInstanceTable_g[0]
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for declaration, initializing and member access for instance pointer
|
|
|
|
|
// This class of macros are used by CANopen internal function to point to one instance.
|
|
|
|
|
|
|
|
|
|
// macros for declaration within the function header, prototype or local var list
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_PTR void
|
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_PTR_
|
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_PTR_LOCAL
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for reference of pointer to instance
|
|
|
|
|
// These macros are used for parameter passing to called function.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_INSTANCE_PTR
|
|
|
|
|
#define EPL_MCO_INSTANCE_PTR_
|
|
|
|
|
#define EPL_MCO_ADDR_INSTANCE_PTR_
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for process pointer to instance
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_GET_INSTANCE_PTR()
|
|
|
|
|
#define EPL_MCO_GET_FREE_INSTANCE_PTR()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// This macro should be used to check the passed pointer to an public function
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_CHECK_INSTANCE_STATE()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for declaration of pointer to instance pointer
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DECL_PTR_INSTANCE_PTR void
|
|
|
|
|
#define EPL_MCO_DECL_PTR_INSTANCE_PTR_
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for reference of pointer to instance pointer
|
|
|
|
|
// These macros are used for parameter passing to called function.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_PTR_INSTANCE_PTR
|
|
|
|
|
#define EPL_MCO_PTR_INSTANCE_PTR_
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macros for process pointer to instance pointer
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_CHECK_PTR_INSTANCE_PTR()
|
|
|
|
|
#define EPL_MCO_SET_PTR_INSTANCE_PTR()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_INSTANCE_PARAM(a)
|
|
|
|
|
#define EPL_MCO_INSTANCE_PARAM_(a)
|
|
|
|
|
#define EPL_MCO_INSTANCE_PARAM_IDX_()
|
|
|
|
|
#define EPL_MCO_INSTANCE_PARAM_IDX()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// macro for access of struct members of one instance
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_INST_ENTRY aEplInstanceTable_g[0]
|
|
|
|
|
#define EPL_MCO_GLB_VAR(var) (var)
|
|
|
|
|
#define EPL_MCO_WRITE_INSTANCE_STATE(a)
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// this macro deletes all instance entries as unused
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DELETE_INSTANCE_TABLE()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// definition of functions which has to be defined in each module of CANopen stack
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DEFINE_INSTANCE_FCT()
|
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_FCT()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// this macro defines the instance table. Each entry is reserved for an instance of CANopen.
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_VAR()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
// this macro defines member variables in instance table which are needed in
|
|
|
|
|
// all modules of CANopen stack
|
2008-12-20 01:09:38 +00:00
|
|
|
|
#define EPL_MCO_DECL_INSTANCE_MEMBER()
|
2008-12-19 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
#if (CDRV_MAX_INSTANCES > 1)
|
|
|
|
|
|
|
|
|
|
#define CDRV_REENTRANT REENTRANT
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
#define CDRV_REENTRANT
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#endif // _EPLINSTDEF_H_
|
|
|
|
|
|
|
|
|
|
// Die letzte Zeile mu<6D> unbedingt eine leere Zeile sein, weil manche Compiler
|
|
|
|
|
// damit ein Problem haben, wenn das nicht so ist (z.B. GNU oder Borland C++ Builder).
|