#ifndef CGLOBAL_H #define CGLOBAL_H /*********************************************************************** * Project : Framework * * File : CGlobal.h * Author : JW * Date : 04.05.2006 ***********************************************************************/ /** * * This file contains the common elementar data types used in the * project. Using Int8, Int16 etc. help easiliy porting the codes. * This file does not contain any specific hardware pins or ports */ // comment the line below to avoid including MOST-headers. // this could be used to compile the system library without MOST. #define USE_MOSTDRIVER // synonyme for elementar data types typedef signed char Int8; typedef unsigned char UInt8; typedef signed short Int16; typedef unsigned short UInt16; typedef signed int Int32; typedef unsigned int UInt32; // Definition für nullpointer und null character #define NULLPTR 0 #define NULLCHAR 0 // Macro used to round up the memory required due to the alignment #define MAKE_ALIGNMENT_SIZE(size) ((( (size) + (sizeof(Int32) - 1) ) \ / sizeof(Int32))*sizeof(Int32)) // the follwing macros work for Little and Big-Endian #define MAKE_INT16(a,b) Int16( ((UInt16) a << 8) | UInt8(b) ) #define MAKE_UINT16(a,b) UInt16( ((UInt16) a << 8) | UInt8(b) ) #define LOW_BYTE(w) UInt8(w&0xFF) #define HIGH_BYTE(w) UInt8(w >> 8) #endif // CGLOBAL_H