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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
/****************************************************************************
global project definition file
12.06.1998 -rs
11.02.2002 r.d. Erweiterungen, Ergaenzungen
20.08.2002 SYS TEC electronic -as
Definition Schluesselwort 'GENERIC'
fuer das Erzeugen von Generic Pointer
28.08.2002 r.d. erweiterter SYS TEC Debug Code
16.09.2002 r.d. komplette Uebersetzung in Englisch
11.04.2003 f.j. Ergaenzung fuer Mitsubishi NC30 Compiler
17.06.2003 -rs Definition von Basistypen in <#ifndef _WINDEF_> gesetzt
16.04.2004 r.d. Ergaenzung fuer Borland C++ Builder
30.08.2004 -rs TRACE5 eingefügt
23.12.2005 d.k. Definitions for IAR compiler
$Id: global.h,v 1.6 2008/11/07 13:55:56 D.Krueger Exp $
****************************************************************************/
#ifndef _GLOBAL_H_
#define _GLOBAL_H_
#ifndef QWORD
#define QWORD long long int
#endif
// ------------------ GNUC for I386 ---------------------------------------------
#define HWACC // hardware access through external memory (i.e. CAN)
#define MEM // Memory attribute to optimize speed and code of pointer access.
#ifndef CONST
#define CONST const // variables mapped to ROM (i.e. flash)
#endif
#define REENTRANT
#define TRACE printk
#ifndef SHORT
#define SHORT short int
#endif
#ifndef USHORT
#define USHORT unsigned short int
#endif
#ifndef INT
#define INT int
#endif
#ifndef UINT
#define UINT unsigned int
#endif
#ifndef LONG
#define LONG long int
#endif
#ifndef ULONG
#define ULONG unsigned long int
#endif
// --- logic types ---
#ifndef BYTE
#define BYTE unsigned char
#endif
#ifndef WORD
#define WORD unsigned short int
#endif
#ifndef DWORD
#define DWORD unsigned long int
#endif
#ifndef BOOL
#define BOOL unsigned char
#endif
// --- alias types ---
#ifndef TRUE
#define TRUE 0xFF
#endif
#ifndef FALSE
#define FALSE 0x00
#endif
#ifndef _TIME_OF_DAY_DEFINED_
typedef struct {
unsigned long int m_dwMs;
unsigned short int m_wDays;
} tTimeOfDay;
#define _TIME_OF_DAY_DEFINED_
#endif
//---------------------------------------------------------------------------
// Definition von TRACE
//---------------------------------------------------------------------------
#ifndef NDEBUG
#ifndef TRACE0
#define TRACE0(p0) TRACE(p0)
#endif
#ifndef TRACE1
#define TRACE1(p0, p1) TRACE(p0, p1)
#endif
#ifndef TRACE2
#define TRACE2(p0, p1, p2) TRACE(p0, p1, p2)
#endif
#ifndef TRACE3
#define TRACE3(p0, p1, p2, p3) TRACE(p0, p1, p2, p3)
#endif
#ifndef TRACE4
#define TRACE4(p0, p1, p2, p3, p4) TRACE(p0, p1, p2, p3, p4)
#endif
#ifndef TRACE5
#define TRACE5(p0, p1, p2, p3, p4, p5) TRACE(p0, p1, p2, p3, p4, p5)
#endif
#ifndef TRACE6
#define TRACE6(p0, p1, p2, p3, p4, p5, p6) TRACE(p0, p1, p2, p3, p4, p5, p6)
#endif
#else
#ifndef TRACE0
#define TRACE0(p0)
#endif
#ifndef TRACE1
#define TRACE1(p0, p1)
#endif
#ifndef TRACE2
#define TRACE2(p0, p1, p2)
#endif
#ifndef TRACE3
#define TRACE3(p0, p1, p2, p3)
#endif
#ifndef TRACE4
#define TRACE4(p0, p1, p2, p3, p4)
#endif
#ifndef TRACE5
#define TRACE5(p0, p1, p2, p3, p4, p5)
#endif
#ifndef TRACE6
#define TRACE6(p0, p1, p2, p3, p4, p5, p6)
#endif
#endif
//---------------------------------------------------------------------------
// definition of ASSERT
//---------------------------------------------------------------------------
#ifndef ASSERT
#define ASSERT(p)
#endif
//---------------------------------------------------------------------------
// SYS TEC extensions
//---------------------------------------------------------------------------
// This macro doesn't print out C-file and line number of the failed assertion
// but a string, which exactly names the mistake.
#ifndef NDEBUG
#define ASSERTMSG(expr,string) if (!(expr)) {\
PRINTF0 ("Assertion failed: " string );\
while (1);}
#else
#define ASSERTMSG(expr,string)
#endif
//---------------------------------------------------------------------------
#endif // #ifndef _GLOBAL_H_
// Please keep an empty line at the end of this file.
|