📄 def.h
字号:
/***************************************************************************
def.h - description
-------------------
begin : Fri May 17 2002
copyright : (C) 2002 by Raphael Zulliger
email : zulli@hsr.ch
***************************************************************************/
/***************************************************************************
* *
* This library is Copyright (c) Raphael Zulliger <zulli@gmx.net>. *
* It is licensed under the GNU Library General Public License (LGPL). *
* *
***************************************************************************/
/** \file
* \brief File for various definitions
*
*
* In this file you'll find a lot of definitions, such as datatypes and
* constants (defines)
*/
#ifndef __def_h__
#define __def_h__
#include <string.h>
/** 8 Bit unsigned
*/
#define BYTE unsigned char
/** 16 Bit unsigned
*/
#define WORD unsigned short // Microchip mcc18: 16bit
/** 32 Bit unsigned
*/
#define DWORD unsigned long // Microchip mcc18: 32bit
/** 1 Bit
*/
#define BIT bit
#ifdef ARBRACAN
/** Far-memory
*/
#define FAR
/** Put variable automatically into memory-space
*/
#define AUTO
/** Put variable into RAM
*/
#define RAM
/** Put variable into extended RAM
*/
#define XDATA
/** Put this part in code (ROM)
*/
#define CODE // data that belongs to the ROM
#endif
#ifdef PIC_CAN
/** Put variable into extended RAM
*/
#define XDATA ram // data that are in RAM
/** Far-memory
*/
#define FAR far
/** Put variable automatically into memory-space
*/
#define AUTO auto
/** Put variable into RAM
*/
#define RAM ram
/** Put this part in code (ROM)
*/
#define CODE rom // data that belongs to the ROM
#endif
#define XHUGE // generic pointer
/** definitions used for object dictionary access
*/
/** If someone/something tries to access an object dictionary entry
* which doesn't exist
*/
#define NO_SUCH_INDEX 0x11
/** Return value that indicates a successful operation
*/
#define SUCCESSFUL 0x12
/** If someone/something tries to access an object dictioary subentry (subindex)
* which doesn't exist
*/
#define SUBINDEX_NOT_EXIST 0x13
/** lifeguard: connection is OK
*/
#define CONNECTION_OK 0x33
/** lifeguard: connection failed
*/
#define CONNECTION_FAILED 0x31
/** lifeguard: guarding message lost
*/
#define GUARDING_MESSAGE_LOST 0x32
/** lifeguard: heartbeat message lost
*/
#define HEARTBEAT_MESSAGE_LOST 0x34
/** lifegurad: heartbeat consumer lost
*/
#define HEARTBEAT_CONSUMER_LOST 0x35
// predefined error-codes. neccessary for sending an emergency-message
/** internal device error: no error
*/
#define NO_ERROR 0x0000
/** internal device error: generic error
*/
#define GENERIC_ERROR 0x1000
/** internal device error: current error
*/
#define CURRENT_ERROR 0x2000
/** internal device error: voltage error
*/
#define VOLTAGE_ERROR 0x3000
/** internal device error: hardware error
*/
#define HARDWARE_ERROR 0x5000
// ... (the user can define more errors here)
typedef enum _BOOL { FALSE = 0, TRUE } BOOL;
#endif // __def_h__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -