blob: eaa6d1874b090e27acf125a856a2051ec065ab12 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#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
|