aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/epl/EplInstDef.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-12-19 17:09:38 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-06 13:52:37 -0800
commite0ca0595885e2e324eefe4f32cde6d65e61e6e28 (patch)
treec53676354254656be8d1f197f5d8f88526355b7b /drivers/staging/epl/EplInstDef.h
parentbd5cd82dc6148aa8f655620e6f3bf62e5e320078 (diff)
Staging: epl: run Lindent on *.h files
It's a start, still a mess... Cc: Daniel Krueger <daniel.krueger@systec-electronic.com> Cc: Ronald Sieber <Ronald.Sieber@systec-electronic.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/epl/EplInstDef.h')
-rw-r--r--drivers/staging/epl/EplInstDef.h221
1 files changed, 106 insertions, 115 deletions
diff --git a/drivers/staging/epl/EplInstDef.h b/drivers/staging/epl/EplInstDef.h
index ab9bafabf42..89efbf27826 100644
--- a/drivers/staging/epl/EplInstDef.h
+++ b/drivers/staging/epl/EplInstDef.h
@@ -71,23 +71,20 @@
#ifndef _EPLINSTDEF_H_
#define _EPLINSTDEF_H_
-
// =========================================================================
// types and macros for generating instances
// =========================================================================
-typedef enum
-{
- kStateUnused = 0,
- kStateDeleted = 1,
- kStateUsed = 0xFF
-
+typedef enum {
+ kStateUnused = 0,
+ kStateDeleted = 1,
+ kStateUsed = 0xFF
} tInstState;
//------------------------------------------------------------------------------------------
-typedef void MEM* tEplPtrInstance;
-typedef BYTE tEplInstanceHdl;
+typedef void MEM *tEplPtrInstance;
+typedef BYTE tEplInstanceHdl;
// define const for illegale values
#define CCM_ILLINSTANCE NULL
@@ -102,13 +99,12 @@ typedef BYTE tEplInstanceHdl;
//--------------------------------------------------------------------------------------
// memory attributes for instance table
- #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
-
- #define INSTANCE_TYPE_BEGIN typedef struct {
- #define INSTANCE_TYPE_END } tEplInstanceInfo;
+#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
+#define INSTANCE_TYPE_BEGIN typedef struct {
+#define INSTANCE_TYPE_END } tEplInstanceInfo;
//--------------------------------------------------------------------------------------
// macro definition for API interface
@@ -117,53 +113,51 @@ typedef BYTE tEplInstanceHdl;
// declaration:
// macros for declaration within function header or prototype of API functions
- #define CCM_DECL_INSTANCE_HDL tEplInstanceHdl InstanceHandle
- #define CCM_DECL_INSTANCE_HDL_ tEplInstanceHdl InstanceHandle,
+#define CCM_DECL_INSTANCE_HDL tEplInstanceHdl InstanceHandle
+#define CCM_DECL_INSTANCE_HDL_ tEplInstanceHdl InstanceHandle,
// macros for declaration of pointer to instance handle within function header or prototype of API functions
- #define CCM_DECL_PTR_INSTANCE_HDL tEplInstanceHdl MEM* pInstanceHandle
- #define CCM_DECL_PTR_INSTANCE_HDL_ tEplInstanceHdl MEM* pInstanceHandle,
+#define CCM_DECL_PTR_INSTANCE_HDL tEplInstanceHdl MEM* pInstanceHandle
+#define CCM_DECL_PTR_INSTANCE_HDL_ tEplInstanceHdl MEM* pInstanceHandle,
// macros for declaration instance as lokacl variable within functions
- #define CCM_DECL_INSTANCE_PTR_LOCAL tCcmInstanceInfo MEM* pInstance;
- #define CCM_DECL_PTR_INSTANCE_HDL_LOCAL tEplInstanceHdl MEM* pInstanceHandle;
+#define CCM_DECL_INSTANCE_PTR_LOCAL tCcmInstanceInfo MEM* pInstance;
+#define CCM_DECL_PTR_INSTANCE_HDL_LOCAL tEplInstanceHdl MEM* pInstanceHandle;
// reference:
// macros for reference of instance handle for function parameters
- #define CCM_INSTANCE_HDL InstanceHandle
- #define CCM_INSTANCE_HDL_ InstanceHandle,
+#define CCM_INSTANCE_HDL InstanceHandle
+#define CCM_INSTANCE_HDL_ InstanceHandle,
// macros for reference of instance parameter for function parameters
- #define CCM_INSTANCE_PARAM(par) par
- #define CCM_INSTANCE_PARAM_(par) par,
+#define CCM_INSTANCE_PARAM(par) par
+#define CCM_INSTANCE_PARAM_(par) par,
// macros for reference of instance parameter for writing or reading values
- #define CCM_INST_ENTRY (*((tEplPtrInstance)pInstance))
+#define CCM_INST_ENTRY (*((tEplPtrInstance)pInstance))
// processing:
// macros for process instance handle
- #define CCM_CHECK_INSTANCE_HDL() if (InstanceHandle >= EPL_MAX_INSTANCES) \
+#define CCM_CHECK_INSTANCE_HDL() if (InstanceHandle >= EPL_MAX_INSTANCES) \
{return (kEplIllegalInstance);}
-
// macros for process pointer to instance handle
- #define CCM_CHECK_PTR_INSTANCE_HDL() if (pInstanceHandle == NULL) \
+#define CCM_CHECK_PTR_INSTANCE_HDL() if (pInstanceHandle == NULL) \
{return (kEplInvalidInstanceParam);}
// This macro returned the handle and pointer to next free instance.
- #define CCM_GET_FREE_INSTANCE_AND_HDL() pInstance = CcmGetFreeInstanceAndHandle (pInstanceHandle); \
+#define CCM_GET_FREE_INSTANCE_AND_HDL() pInstance = CcmGetFreeInstanceAndHandle (pInstanceHandle); \
ASSERT (*pInstanceHandle != CCM_ILLINSTANCE_HDL);
- #define CCM_CHECK_INSTANCE_PTR() if (pInstance == CCM_ILLINSTANCE) \
+#define CCM_CHECK_INSTANCE_PTR() if (pInstance == CCM_ILLINSTANCE) \
{return (kEplNoFreeInstance);}
- #define CCM_GET_INSTANCE_PTR() pInstance = CcmGetInstancePtr (InstanceHandle);
- #define CCM_GET_FREE_INSTANCE_PTR() pInstance = GetFreeInstance (); \
+#define CCM_GET_INSTANCE_PTR() pInstance = CcmGetInstancePtr (InstanceHandle);
+#define CCM_GET_FREE_INSTANCE_PTR() pInstance = GetFreeInstance (); \
ASSERT (pInstance != CCM_ILLINSTANCE);
-
//--------------------------------------------------------------------------------------
// macro definition for stack interface
//--------------------------------------------------------------------------------------
@@ -171,52 +165,52 @@ typedef BYTE tEplInstanceHdl;
// 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.
- #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;
+#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;
// macros for reference of pointer to instance
// These macros are used for parameter passing to called function.
- #define EPL_MCO_INSTANCE_PTR pInstance
- #define EPL_MCO_INSTANCE_PTR_ pInstance,
- #define EPL_MCO_ADDR_INSTANCE_PTR_ &pInstance,
+#define EPL_MCO_INSTANCE_PTR pInstance
+#define EPL_MCO_INSTANCE_PTR_ pInstance,
+#define EPL_MCO_ADDR_INSTANCE_PTR_ &pInstance,
// 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.
- #define EPL_MCO_INST_ENTRY (*(tEplPtrInstance)pInstance)
- #define EPL_MCO_GLB_VAR(var) (((tEplPtrInstance)pInstance)->var)
+#define EPL_MCO_INST_ENTRY (*(tEplPtrInstance)pInstance)
+#define EPL_MCO_GLB_VAR(var) (((tEplPtrInstance)pInstance)->var)
// macros for process pointer to instance
- #define EPL_MCO_GET_INSTANCE_PTR() pInstance = (tEplPtrInstance) GetInstancePtr (InstanceHandle);
- #define EPL_MCO_GET_FREE_INSTANCE_PTR() pInstance = (tEplPtrInstance) GetFreeInstance (); \
+#define EPL_MCO_GET_INSTANCE_PTR() pInstance = (tEplPtrInstance) GetInstancePtr (InstanceHandle);
+#define EPL_MCO_GET_FREE_INSTANCE_PTR() pInstance = (tEplPtrInstance) GetFreeInstance (); \
ASSERT (pInstance != CCM_ILLINSTANCE);
// This macro should be used to check the passed pointer to an public function
- #define EPL_MCO_CHECK_INSTANCE_STATE() ASSERT (pInstance != NULL); \
+#define EPL_MCO_CHECK_INSTANCE_STATE() ASSERT (pInstance != NULL); \
ASSERT (((tEplPtrInstance)pInstance)->m_InstState == kStateUsed);
// macros for declaration of pointer to instance pointer
- #define EPL_MCO_DECL_PTR_INSTANCE_PTR void MEM* MEM* pInstancePtr
- #define EPL_MCO_DECL_PTR_INSTANCE_PTR_ void MEM* MEM* pInstancePtr,
+#define EPL_MCO_DECL_PTR_INSTANCE_PTR void MEM* MEM* pInstancePtr
+#define EPL_MCO_DECL_PTR_INSTANCE_PTR_ void MEM* MEM* pInstancePtr,
// macros for reference of pointer to instance pointer
// These macros are used for parameter passing to called function.
- #define EPL_MCO_PTR_INSTANCE_PTR pInstancePtr
- #define EPL_MCO_PTR_INSTANCE_PTR_ pInstancePtr,
+#define EPL_MCO_PTR_INSTANCE_PTR pInstancePtr
+#define EPL_MCO_PTR_INSTANCE_PTR_ pInstancePtr,
// macros for process pointer to instance pointer
- #define EPL_MCO_CHECK_PTR_INSTANCE_PTR() ASSERT (pInstancePtr != NULL);
- #define EPL_MCO_SET_PTR_INSTANCE_PTR() (*pInstancePtr = pInstance);
+#define EPL_MCO_CHECK_PTR_INSTANCE_PTR() ASSERT (pInstancePtr != NULL);
+#define EPL_MCO_SET_PTR_INSTANCE_PTR() (*pInstancePtr = pInstance);
- #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;
+#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;
// this macro deletes all instance entries as unused
- #define EPL_MCO_DELETE_INSTANCE_TABLE() \
+#define EPL_MCO_DELETE_INSTANCE_TABLE() \
{ \
tEplInstanceInfo MEM* pInstance = &aEplInstanceTable_g[0]; \
tFastByte InstNumber = 0; \
@@ -229,10 +223,10 @@ typedef BYTE tEplInstanceHdl;
}
// definition of functions which has to be defined in each module of CANopen stack
- #define EPL_MCO_DEFINE_INSTANCE_FCT() \
+#define EPL_MCO_DEFINE_INSTANCE_FCT() \
static tEplPtrInstance GetInstancePtr (tEplInstanceHdl InstHandle_p); \
static tEplPtrInstance GetFreeInstance (void);
- #define EPL_MCO_DECL_INSTANCE_FCT() \
+#define EPL_MCO_DECL_INSTANCE_FCT() \
static tEplPtrInstance GetInstancePtr (tEplInstanceHdl InstHandle_p) { \
return &aEplInstanceTable_g[InstHandle_p]; } \
static tEplPtrInstance GetFreeInstance (void) { \
@@ -245,27 +239,27 @@ typedef BYTE tEplInstanceHdl;
return CCM_ILLINSTANCE; }
// this macro defines the instance table. Each entry is reserved for an instance of CANopen.
- #define EPL_MCO_DECL_INSTANCE_VAR() \
+#define EPL_MCO_DECL_INSTANCE_VAR() \
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
- #define EPL_MCO_DECL_INSTANCE_MEMBER() \
+#define EPL_MCO_DECL_INSTANCE_MEMBER() \
STATIC BYTE m_InstState; \
STATIC BYTE m_bInstIndex;
- #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_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))
-#else // only one instance is used
+#else // only one instance is used
// Memory attributes for instance table.
- #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
+#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
- #define INSTANCE_TYPE_BEGIN
- #define INSTANCE_TYPE_END
+#define INSTANCE_TYPE_BEGIN
+#define INSTANCE_TYPE_END
// macros for declaration, initializing and member access for instance handle
// This class of macros are used by API function to inform CCM-modul which
@@ -273,99 +267,98 @@ typedef BYTE tEplInstanceHdl;
// macros for reference of instance handle
// These macros are used for parameter passing to CANopen API function.
- #define CCM_INSTANCE_HDL
- #define CCM_INSTANCE_HDL_
+#define CCM_INSTANCE_HDL
+#define CCM_INSTANCE_HDL_
- #define CCM_DECL_INSTANCE_PTR_LOCAL
+#define CCM_DECL_INSTANCE_PTR_LOCAL
// macros for declaration within the function header or prototype
- #define CCM_DECL_INSTANCE_HDL void
- #define CCM_DECL_INSTANCE_HDL_
+#define CCM_DECL_INSTANCE_HDL void
+#define CCM_DECL_INSTANCE_HDL_
// macros for process instance handle
- #define CCM_CHECK_INSTANCE_HDL()
+#define CCM_CHECK_INSTANCE_HDL()
// macros for declaration of pointer to instance handle
- #define CCM_DECL_PTR_INSTANCE_HDL void
- #define CCM_DECL_PTR_INSTANCE_HDL_
+#define CCM_DECL_PTR_INSTANCE_HDL void
+#define CCM_DECL_PTR_INSTANCE_HDL_
// macros for process pointer to instance handle
- #define CCM_CHECK_PTR_INSTANCE_HDL()
+#define CCM_CHECK_PTR_INSTANCE_HDL()
// This macro returned the handle and pointer to next free instance.
- #define CCM_GET_FREE_INSTANCE_AND_HDL()
+#define CCM_GET_FREE_INSTANCE_AND_HDL()
- #define CCM_CHECK_INSTANCE_PTR()
+#define CCM_CHECK_INSTANCE_PTR()
- #define CCM_GET_INSTANCE_PTR()
- #define CCM_GET_FREE_INSTANCE_PTR()
+#define CCM_GET_INSTANCE_PTR()
+#define CCM_GET_FREE_INSTANCE_PTR()
- #define CCM_INSTANCE_PARAM(par)
- #define CCM_INSTANCE_PARAM_(par)
+#define CCM_INSTANCE_PARAM(par)
+#define CCM_INSTANCE_PARAM_(par)
- #define CCM_INST_ENTRY aCcmInstanceTable_g[0]
+#define CCM_INST_ENTRY aCcmInstanceTable_g[0]
// 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
- #define EPL_MCO_DECL_INSTANCE_PTR void
- #define EPL_MCO_DECL_INSTANCE_PTR_
- #define EPL_MCO_DECL_INSTANCE_PTR_LOCAL
+#define EPL_MCO_DECL_INSTANCE_PTR void
+#define EPL_MCO_DECL_INSTANCE_PTR_
+#define EPL_MCO_DECL_INSTANCE_PTR_LOCAL
// macros for reference of pointer to instance
// These macros are used for parameter passing to called function.
- #define EPL_MCO_INSTANCE_PTR
- #define EPL_MCO_INSTANCE_PTR_
- #define EPL_MCO_ADDR_INSTANCE_PTR_
+#define EPL_MCO_INSTANCE_PTR
+#define EPL_MCO_INSTANCE_PTR_
+#define EPL_MCO_ADDR_INSTANCE_PTR_
// macros for process pointer to instance
- #define EPL_MCO_GET_INSTANCE_PTR()
- #define EPL_MCO_GET_FREE_INSTANCE_PTR()
+#define EPL_MCO_GET_INSTANCE_PTR()
+#define EPL_MCO_GET_FREE_INSTANCE_PTR()
// This macro should be used to check the passed pointer to an public function
- #define EPL_MCO_CHECK_INSTANCE_STATE()
+#define EPL_MCO_CHECK_INSTANCE_STATE()
// macros for declaration of pointer to instance pointer
- #define EPL_MCO_DECL_PTR_INSTANCE_PTR void
- #define EPL_MCO_DECL_PTR_INSTANCE_PTR_
+#define EPL_MCO_DECL_PTR_INSTANCE_PTR void
+#define EPL_MCO_DECL_PTR_INSTANCE_PTR_
// macros for reference of pointer to instance pointer
// These macros are used for parameter passing to called function.
- #define EPL_MCO_PTR_INSTANCE_PTR
- #define EPL_MCO_PTR_INSTANCE_PTR_
+#define EPL_MCO_PTR_INSTANCE_PTR
+#define EPL_MCO_PTR_INSTANCE_PTR_
// macros for process pointer to instance pointer
- #define EPL_MCO_CHECK_PTR_INSTANCE_PTR()
- #define EPL_MCO_SET_PTR_INSTANCE_PTR()
+#define EPL_MCO_CHECK_PTR_INSTANCE_PTR()
+#define EPL_MCO_SET_PTR_INSTANCE_PTR()
- #define EPL_MCO_INSTANCE_PARAM(a)
- #define EPL_MCO_INSTANCE_PARAM_(a)
- #define EPL_MCO_INSTANCE_PARAM_IDX_()
- #define EPL_MCO_INSTANCE_PARAM_IDX()
+#define EPL_MCO_INSTANCE_PARAM(a)
+#define EPL_MCO_INSTANCE_PARAM_(a)
+#define EPL_MCO_INSTANCE_PARAM_IDX_()
+#define EPL_MCO_INSTANCE_PARAM_IDX()
// macro for access of struct members of one instance
- #define EPL_MCO_INST_ENTRY aEplInstanceTable_g[0]
- #define EPL_MCO_GLB_VAR(var) (var)
- #define EPL_MCO_WRITE_INSTANCE_STATE(a)
+#define EPL_MCO_INST_ENTRY aEplInstanceTable_g[0]
+#define EPL_MCO_GLB_VAR(var) (var)
+#define EPL_MCO_WRITE_INSTANCE_STATE(a)
// this macro deletes all instance entries as unused
- #define EPL_MCO_DELETE_INSTANCE_TABLE()
+#define EPL_MCO_DELETE_INSTANCE_TABLE()
// definition of functions which has to be defined in each module of CANopen stack
- #define EPL_MCO_DEFINE_INSTANCE_FCT()
- #define EPL_MCO_DECL_INSTANCE_FCT()
+#define EPL_MCO_DEFINE_INSTANCE_FCT()
+#define EPL_MCO_DECL_INSTANCE_FCT()
// this macro defines the instance table. Each entry is reserved for an instance of CANopen.
- #define EPL_MCO_DECL_INSTANCE_VAR()
+#define EPL_MCO_DECL_INSTANCE_VAR()
// this macro defines member variables in instance table which are needed in
// all modules of CANopen stack
- #define EPL_MCO_DECL_INSTANCE_MEMBER()
+#define EPL_MCO_DECL_INSTANCE_MEMBER()
#endif
-
/*
#if (CDRV_MAX_INSTANCES > 1)
@@ -378,9 +371,7 @@ typedef BYTE tEplInstanceHdl;
#endif
*/
-
#endif // _EPLINSTDEF_H_
// Die letzte Zeile muß unbedingt eine leere Zeile sein, weil manche Compiler
// damit ein Problem haben, wenn das nicht so ist (z.B. GNU oder Borland C++ Builder).
-