aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/epl/global.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/epl/global.h')
-rw-r--r--drivers/staging/epl/global.h1771
1 files changed, 847 insertions, 924 deletions
diff --git a/drivers/staging/epl/global.h b/drivers/staging/epl/global.h
index 797e1f27835..fe167165a83 100644
--- a/drivers/staging/epl/global.h
+++ b/drivers/staging/epl/global.h
@@ -22,50 +22,49 @@
22#ifndef _GLOBAL_H_ 22#ifndef _GLOBAL_H_
23#define _GLOBAL_H_ 23#define _GLOBAL_H_
24 24
25
26//--------------------------------------------------------------------------- 25//---------------------------------------------------------------------------
27// elements of defines for development system 26// elements of defines for development system
28//--------------------------------------------------------------------------- 27//---------------------------------------------------------------------------
29 28
30// these defines are necessary to check some of characteristics of the development system 29// these defines are necessary to check some of characteristics of the development system
31#define _DEV_BIGEND_ 0x80000000L // big endian (motorolla format) 30#define _DEV_BIGEND_ 0x80000000L // big endian (motorolla format)
32#define _DEV_ALIGNMENT_4_ 0x00400000L // the CPU needs alignment of 4 bytes 31#define _DEV_ALIGNMENT_4_ 0x00400000L // the CPU needs alignment of 4 bytes
33#define _DEV_ONLY_INT_MAIN_ 0x00004000L // the compiler needs "int main(int)" instead of "void main(void)" 32#define _DEV_ONLY_INT_MAIN_ 0x00004000L // the compiler needs "int main(int)" instead of "void main(void)"
34#define _DEV_COMMA_EXT_ 0x00002000L // support of last comma in struct predefinition 33#define _DEV_COMMA_EXT_ 0x00002000L // support of last comma in struct predefinition
35#define _DEV_64BIT_SUPPORT_ 0x00001000L // support of 64 bit operations 34#define _DEV_64BIT_SUPPORT_ 0x00001000L // support of 64 bit operations
36#define _DEV_BIT64_ 0x00000400L // count of bits: 64 bit 35#define _DEV_BIT64_ 0x00000400L // count of bits: 64 bit
37#define _DEV_BIT32_ 0x00000300L // 32 bit 36#define _DEV_BIT32_ 0x00000300L // 32 bit
38#define _DEV_BIT16_ 0x00000200L // 16 bit 37#define _DEV_BIT16_ 0x00000200L // 16 bit
39#define _DEV_BIT8_ 0x00000100L // 8 bit 38#define _DEV_BIT8_ 0x00000100L // 8 bit
40#define _DEV_RVCT_ARM_ 0x0000001CL // RealView ARM 39#define _DEV_RVCT_ARM_ 0x0000001CL // RealView ARM
41#define _DEV_RENESASM32C 0x0000001BL // compiler from: Renesas 40#define _DEV_RENESASM32C 0x0000001BL // compiler from: Renesas
42#define _DEV_GNUC_MIPS2_ 0x0000001AL // GNU for MIPS2 41#define _DEV_GNUC_MIPS2_ 0x0000001AL // GNU for MIPS2
43#define _DEV_MPLAB_C30_ 0x00000019L // MPLAB C30 for Microchip dsPIC33F series 42#define _DEV_MPLAB_C30_ 0x00000019L // MPLAB C30 for Microchip dsPIC33F series
44#define _DEV_GNUC_TC_ 0x00000018L // GNU for Infineon TriCore 43#define _DEV_GNUC_TC_ 0x00000018L // GNU for Infineon TriCore
45#define _DEV_GNUC_X86_ 0x00000017L // GNU for I386 44#define _DEV_GNUC_X86_ 0x00000017L // GNU for I386
46#define _DEV_IAR_ARM_ 0x00000016L // ARM IAR C/C++ Compiler 45#define _DEV_IAR_ARM_ 0x00000016L // ARM IAR C/C++ Compiler
47#define _DEV_PARADGM_X86 0x00000015L // Paradigm C/C++ for Beck 1x3 46#define _DEV_PARADGM_X86 0x00000015L // Paradigm C/C++ for Beck 1x3
48#define _DEV_GNUC_CF_ 0x00000014L // GNU for Coldfire 47#define _DEV_GNUC_CF_ 0x00000014L // GNU for Coldfire
49#define _DEV_KEIL_ARM_ 0x00000013L // Keil ARM 48#define _DEV_KEIL_ARM_ 0x00000013L // Keil ARM
50#define _DEV_MSEVC_ 0x00000012L // Microsoft embedded Visual C/C++ 49#define _DEV_MSEVC_ 0x00000012L // Microsoft embedded Visual C/C++
51#define _DEV_HIGHTEC_GNUC_X86_ 0x00000011L // Hightec elf386 gcc 50#define _DEV_HIGHTEC_GNUC_X86_ 0x00000011L // Hightec elf386 gcc
52#define _DEV_MSVC_RTX_ 0x00000010L // VC600 + RTX 51#define _DEV_MSVC_RTX_ 0x00000010L // VC600 + RTX
53#define _DEV_MSVC_V1_5_ 0x0000000FL // Microsoft Visual C/C++ V1.5 52#define _DEV_MSVC_V1_5_ 0x0000000FL // Microsoft Visual C/C++ V1.5
54#define _DEV_GNUC_ARM7_ 0x0000000EL // GNU Compiler gcc for ARM7 53#define _DEV_GNUC_ARM7_ 0x0000000EL // GNU Compiler gcc for ARM7
55#define _DEV_METROWERKS_CW_ 0x0000000DL // Metrowerks Code Warrior 54#define _DEV_METROWERKS_CW_ 0x0000000DL // Metrowerks Code Warrior
56#define _DEV_MITSUBISHIM16C_ 0x0000000CL //compiler from: Mitsubishi 55#define _DEV_MITSUBISHIM16C_ 0x0000000CL //compiler from: Mitsubishi
57#define _DEV_GNUC_C16X_ 0x0000000BL // GNU Compiler gcc166 for Infineon C16x 56#define _DEV_GNUC_C16X_ 0x0000000BL // GNU Compiler gcc166 for Infineon C16x
58#define _DEV_LINUX_GCC_ 0x0000000AL // Linux GNU Compiler gcc 57#define _DEV_LINUX_GCC_ 0x0000000AL // Linux GNU Compiler gcc
59#define _DEV_GNUC_MPC5X5 0x00000009L // GNU for Motorola PPC5x5 58#define _DEV_GNUC_MPC5X5 0x00000009L // GNU for Motorola PPC5x5
60#define _DEV_TASKINGM16C_ 0x00000008L // Tasking for Mitsubishi M16C 59#define _DEV_TASKINGM16C_ 0x00000008L // Tasking for Mitsubishi M16C
61#define _DEV_FUJITSU_ 0x00000007L // Fujitsu 60#define _DEV_FUJITSU_ 0x00000007L // Fujitsu
62#define _DEV_TASKING8_ 0x00000006L // Tasking 8051 61#define _DEV_TASKING8_ 0x00000006L // Tasking 8051
63#define _DEV_TASKING16_ 0x00000005L // Tasking 166 62#define _DEV_TASKING16_ 0x00000005L // Tasking 166
64#define _DEV_KEIL8_ 0x00000004L // Keil C51 63#define _DEV_KEIL8_ 0x00000004L // Keil C51
65#define _DEV_KEIL16_ 0x00000003L // Keil C166 64#define _DEV_KEIL16_ 0x00000003L // Keil C166
66#define _DEV_BORLANDC_ 0x00000002L // Borland C/C++ 65#define _DEV_BORLANDC_ 0x00000002L // Borland C/C++
67#define _DEV_MSVC16_ 0x00000001L // Microsoft Visual C/C++ 66#define _DEV_MSVC16_ 0x00000001L // Microsoft Visual C/C++
68#define _DEV_MSVC32_ 0x00000000L // Microsoft Visual C/C++ 67#define _DEV_MSVC32_ 0x00000000L // Microsoft Visual C/C++
69 68
70// these defines can be used to mask previous elements 69// these defines can be used to mask previous elements
71#define _DEV_MASK_COMPILER 0x000000FFL 70#define _DEV_MASK_COMPILER 0x000000FFL
@@ -73,7 +72,6 @@
73#define _DEV_MASK_ADDSUPPORT 0x0000F000L 72#define _DEV_MASK_ADDSUPPORT 0x0000F000L
74#define _DEV_MASK_ALIGNMENT 0x00F00000L 73#define _DEV_MASK_ALIGNMENT 0x00F00000L
75 74
76
77//--------------------------------------------------------------------------- 75//---------------------------------------------------------------------------
78// defines for development system (DEV_SYSTEM) including previous elements 76// defines for development system (DEV_SYSTEM) including previous elements
79//--------------------------------------------------------------------------- 77//---------------------------------------------------------------------------
@@ -81,34 +79,34 @@
81#define _DEV_WIN16_ (_DEV_BIT16_ | _DEV_MSVC16_ ) 79#define _DEV_WIN16_ (_DEV_BIT16_ | _DEV_MSVC16_ )
82#define _DEV_WIN32_ (_DEV_BIT32_ | _DEV_MSVC32_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 80#define _DEV_WIN32_ (_DEV_BIT32_ | _DEV_MSVC32_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
83#define _DEV_MSVC_DOS_ (_DEV_BIT32_ | _DEV_MSVC_V1_5_ ) 81#define _DEV_MSVC_DOS_ (_DEV_BIT32_ | _DEV_MSVC_V1_5_ )
84#define _DEV_BORLAND_DOS_ (_DEV_BIT32_ | _DEV_BORLANDC_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 82#define _DEV_BORLAND_DOS_ (_DEV_BIT32_ | _DEV_BORLANDC_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
85#define _DEV_KEIL_C51X_ (_DEV_BIT8_ | _DEV_KEIL8_ | _DEV_BIGEND_ | _DEV_COMMA_EXT_) // at least C51 version 7.05 supports comma extension 83#define _DEV_KEIL_C51X_ (_DEV_BIT8_ | _DEV_KEIL8_ | _DEV_BIGEND_ | _DEV_COMMA_EXT_) // at least C51 version 7.05 supports comma extension
86#define _DEV_KEIL_C16X_ (_DEV_BIT16_ | _DEV_KEIL16_ | _DEV_COMMA_EXT_) // at least C166 version 5.03 supports comma extension 84#define _DEV_KEIL_C16X_ (_DEV_BIT16_ | _DEV_KEIL16_ | _DEV_COMMA_EXT_) // at least C166 version 5.03 supports comma extension
87#define _DEV_TASKING_C51X_ (_DEV_BIT8_ | _DEV_TASKING8_ | _DEV_BIGEND_) 85#define _DEV_TASKING_C51X_ (_DEV_BIT8_ | _DEV_TASKING8_ | _DEV_BIGEND_)
88#define _DEV_TASKING_C16X_ (_DEV_BIT16_ | _DEV_TASKING16_ ) 86#define _DEV_TASKING_C16X_ (_DEV_BIT16_ | _DEV_TASKING16_ )
89#define _DEV_FUJITSU_F590_ (_DEV_BIT8_ | _DEV_FUJITSU_ | _DEV_COMMA_EXT_) // softune is not able to support 64 bit variables QWORD !!! 87#define _DEV_FUJITSU_F590_ (_DEV_BIT8_ | _DEV_FUJITSU_ | _DEV_COMMA_EXT_) // softune is not able to support 64 bit variables QWORD !!!
90//f.j.29.04.03 M16C kann effektiv mit Bytes umgehen 88//f.j.29.04.03 M16C kann effektiv mit Bytes umgehen
91//#define _DEV_TASKING_M16C_ (_DEV_BIT16_ | _DEV_TASKINGM16C_ ) 89//#define _DEV_TASKING_M16C_ (_DEV_BIT16_ | _DEV_TASKINGM16C_ )
92#define _DEV_TASKING_M16C_ (_DEV_BIT8_ | _DEV_TASKINGM16C_ ) 90#define _DEV_TASKING_M16C_ (_DEV_BIT8_ | _DEV_TASKINGM16C_ )
93#define _DEV_MITSUBISHI_M16C_ (_DEV_BIT8_ | _DEV_MITSUBISHIM16C_ ) 91#define _DEV_MITSUBISHI_M16C_ (_DEV_BIT8_ | _DEV_MITSUBISHIM16C_ )
94#define _DEV_GNU_MPC5X5_ (_DEV_BIT32_ | _DEV_GNUC_MPC5X5| _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 92#define _DEV_GNU_MPC5X5_ (_DEV_BIT32_ | _DEV_GNUC_MPC5X5| _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
95#define _DEV_LINUX_ (_DEV_BIT32_ | _DEV_LINUX_GCC_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 93#define _DEV_LINUX_ (_DEV_BIT32_ | _DEV_LINUX_GCC_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
96#define _DEV_GNU_C16X_ (_DEV_BIT16_ | _DEV_GNUC_C16X_ ) //| _DEV_COMMA_EXT_) 94#define _DEV_GNU_C16X_ (_DEV_BIT16_ | _DEV_GNUC_C16X_ ) //| _DEV_COMMA_EXT_)
97#define _DEV_MCW_MPC5X5_ (_DEV_BIT32_ | _DEV_METROWERKS_CW_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 95#define _DEV_MCW_MPC5X5_ (_DEV_BIT32_ | _DEV_METROWERKS_CW_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
98#define _DEV_GNU_ARM7_ (_DEV_BIT32_ | _DEV_GNUC_ARM7_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_) 96#define _DEV_GNU_ARM7_ (_DEV_BIT32_ | _DEV_GNUC_ARM7_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)
99#define _DEV_WIN32_RTX_ (_DEV_BIT32_ | _DEV_MSVC_RTX_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 97#define _DEV_WIN32_RTX_ (_DEV_BIT32_ | _DEV_MSVC_RTX_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
100#define _DEV_HIGHTEC_X86_ (_DEV_BIT32_ | _DEV_HIGHTEC_GNUC_X86_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 98#define _DEV_HIGHTEC_X86_ (_DEV_BIT32_ | _DEV_HIGHTEC_GNUC_X86_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
101#define _DEV_WIN_CE_ (_DEV_BIT32_ | _DEV_MSEVC_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 99#define _DEV_WIN_CE_ (_DEV_BIT32_ | _DEV_MSEVC_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
102#define _DEV_KEIL_CARM_ (_DEV_BIT32_ | _DEV_KEIL_ARM_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 100#define _DEV_KEIL_CARM_ (_DEV_BIT32_ | _DEV_KEIL_ARM_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
103#define _DEV_IAR_CARM_ (_DEV_BIT32_ | _DEV_IAR_ARM_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 101#define _DEV_IAR_CARM_ (_DEV_BIT32_ | _DEV_IAR_ARM_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
104#define _DEV_RVCT_CARM_ (_DEV_BIT32_ | _DEV_RVCT_ARM_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_) 102#define _DEV_RVCT_CARM_ (_DEV_BIT32_ | _DEV_RVCT_ARM_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)
105#define _DEV_MCW_MCF5XXX_ (_DEV_BIT32_ | _DEV_METROWERKS_CW_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 103#define _DEV_MCW_MCF5XXX_ (_DEV_BIT32_ | _DEV_METROWERKS_CW_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
106#define _DEV_GNU_CF5282_ (_DEV_BIT32_ | _DEV_GNUC_CF_ | _DEV_BIGEND_) 104#define _DEV_GNU_CF5282_ (_DEV_BIT32_ | _DEV_GNUC_CF_ | _DEV_BIGEND_)
107#define _DEV_PAR_BECK1X3_ (_DEV_BIT16_ | _DEV_PARADGM_X86) 105#define _DEV_PAR_BECK1X3_ (_DEV_BIT16_ | _DEV_PARADGM_X86)
108#define _DEV_GNU_CF548X_ (_DEV_BIT32_ | _DEV_GNUC_CF_ | _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_) 106#define _DEV_GNU_CF548X_ (_DEV_BIT32_ | _DEV_GNUC_CF_ | _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
109#define _DEV_GNU_I386_ (_DEV_BIT32_ | _DEV_GNUC_X86_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_) 107#define _DEV_GNU_I386_ (_DEV_BIT32_ | _DEV_GNUC_X86_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)
110#define _DEV_GNU_TRICORE_ (_DEV_BIT32_ | _DEV_GNUC_TC_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_ | _DEV_ALIGNMENT_4_) 108#define _DEV_GNU_TRICORE_ (_DEV_BIT32_ | _DEV_GNUC_TC_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_ | _DEV_ALIGNMENT_4_)
111#define _DEV_MPLAB_DSPIC33F_ (_DEV_BIT16_ | _DEV_MPLAB_C30_ ) //| _DEV_COMMA_EXT_) 109#define _DEV_MPLAB_DSPIC33F_ (_DEV_BIT16_ | _DEV_MPLAB_C30_ ) //| _DEV_COMMA_EXT_)
112#define _DEV_GNU_MIPSEL_ (_DEV_BIT32_ | _DEV_GNUC_MIPS2_ | _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_) 110#define _DEV_GNU_MIPSEL_ (_DEV_BIT32_ | _DEV_GNUC_MIPS2_ | _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)
113 111
114#define _DEV_RENESAS_M32C_ (_DEV_BIT32_ | _DEV_RENESASM32C) 112#define _DEV_RENESAS_M32C_ (_DEV_BIT32_ | _DEV_RENESASM32C)
@@ -120,7 +118,6 @@
120#define CHECK_IF_ONLY_INT_MAIN() (DEV_SYSTEM & _DEV_ONLY_INT_MAIN_) 118#define CHECK_IF_ONLY_INT_MAIN() (DEV_SYSTEM & _DEV_ONLY_INT_MAIN_)
121#define CHECK_MEMORY_ALINMENT() (DEV_SYSTEM & _DEV_MASK_ALIGNMENT) 119#define CHECK_MEMORY_ALINMENT() (DEV_SYSTEM & _DEV_MASK_ALIGNMENT)
122 120
123
124//--------------------------------------------------------------------------- 121//---------------------------------------------------------------------------
125// defines for target system (TARGET_SYSTEM) 122// defines for target system (TARGET_SYSTEM)
126//--------------------------------------------------------------------------- 123//---------------------------------------------------------------------------
@@ -134,14 +131,13 @@
134#define _PXROS_ 2 131#define _PXROS_ 2
135#define _ECOSPRO_ 3 132#define _ECOSPRO_ 3
136 133
137
138//--------------------------------------------------------------------------- 134//---------------------------------------------------------------------------
139// definitions for function inlining 135// definitions for function inlining
140//--------------------------------------------------------------------------- 136//---------------------------------------------------------------------------
141 137
142#define INLINE_FUNCTION // empty define 138#define INLINE_FUNCTION // empty define
143#undef INLINE_ENABLED // disable actual inlining of functions 139#undef INLINE_ENABLED // disable actual inlining of functions
144#undef INLINE_FUNCTION_DEF // disable inlining for all compilers per default 140#undef INLINE_FUNCTION_DEF // disable inlining for all compilers per default
145 141
146//--------------------------------------------------------------------------- 142//---------------------------------------------------------------------------
147// definitions for Keil C51 143// definitions for Keil C51
@@ -149,35 +145,34 @@
149 145
150#ifdef __C51__ 146#ifdef __C51__
151 147
152 #define TARGET_SYSTEM _NO_OS_ 148#define TARGET_SYSTEM _NO_OS_
153 #define DEV_SYSTEM _DEV_KEIL_C51X_ 149#define DEV_SYSTEM _DEV_KEIL_C51X_
154 150
155 #pragma DEBUG OBJECTEXTEND 151#pragma DEBUG OBJECTEXTEND
156 #pragma WARNINGLEVEL(2) // maximum warning level 152#pragma WARNINGLEVEL(2) // maximum warning level
157 153
158 #define NEAR idata // variables mapped to internal data storage location 154#define NEAR idata // variables mapped to internal data storage location
159 #define FAR xdata // variables mapped to external data storage location 155#define FAR xdata // variables mapped to external data storage location
160 #define CONST const // variables mapped to ROM (i.e. flash) 156#define CONST const // variables mapped to ROM (i.e. flash)
161 #define ROM code // code or variables mapped to ROM (i.e. flash) 157#define ROM code // code or variables mapped to ROM (i.e. flash)
162 // usage: CONST BYTE ROM foo = 0x00; 158 // usage: CONST BYTE ROM foo = 0x00;
163 #define HWACC xdata // hardware access through external memory (i.e. CAN) 159#define HWACC xdata // hardware access through external memory (i.e. CAN)
164 #define LARGE large // functions set parameters to external data storage location 160#define LARGE large // functions set parameters to external data storage location
165 161
166 // These types can be adjusted by users to match application requirements. The goal is to 162 // These types can be adjusted by users to match application requirements. The goal is to
167 // minimize code memory and maximize speed. 163 // minimize code memory and maximize speed.
168 #define GENERIC // generic pointer to point to application data 164#define GENERIC // generic pointer to point to application data
169 // Variables with this attribute can be located in external 165 // Variables with this attribute can be located in external
170 // or internal data memory. 166 // or internal data memory.
171 #define MEM xdata // Memory attribute to optimize speed and code of pointer access. 167#define MEM xdata // Memory attribute to optimize speed and code of pointer access.
172 168
173 #define REENTRANT reentrant 169#define REENTRANT reentrant
174 #define PUBLIC 170#define PUBLIC
175
176 #ifndef NDEBUG
177 #include <stdio.h> // prototype printf() (for TRACE)
178 #define TRACE printf
179 #endif
180 171
172#ifndef NDEBUG
173#include <stdio.h> // prototype printf() (for TRACE)
174#define TRACE printf
175#endif
181 176
182//--------------------------------------------------------------------------- 177//---------------------------------------------------------------------------
183// definitions for GNU Compiler for Infineon C16x 178// definitions for GNU Compiler for Infineon C16x
@@ -185,36 +180,36 @@
185//--------------------------------------------------------------------------- 180//---------------------------------------------------------------------------
186#elif defined (__GNUC__) && defined (__C166__) 181#elif defined (__GNUC__) && defined (__C166__)
187 182
188 #define TARGET_SYSTEM _NO_OS_ 183#define TARGET_SYSTEM _NO_OS_
189 #define DEV_SYSTEM _DEV_GNU_C16X_ 184#define DEV_SYSTEM _DEV_GNU_C16X_
190 185
191// #define NEAR idata // variables mapped to internal data storage location 186// #define NEAR idata // variables mapped to internal data storage location
192 #define NEAR near // variables mapped to internal data storage location 187#define NEAR near // variables mapped to internal data storage location
193// #define FAR xhuge // variables mapped to external data storage location 188// #define FAR xhuge // variables mapped to external data storage location
194 #define FAR huge // variables mapped to external data storage location 189#define FAR huge // variables mapped to external data storage location
195 #define CONST const // variables mapped to ROM (i.e. flash) 190#define CONST const // variables mapped to ROM (i.e. flash)
196 #define ROM // code or variables mapped to ROM (i.e. flash) 191#define ROM // code or variables mapped to ROM (i.e. flash)
197 // usage: CONST BYTE ROM foo = 0x00; 192 // usage: CONST BYTE ROM foo = 0x00;
198// #define HWACC sdata // hardware access through external memory (i.e. CAN) 193// #define HWACC sdata // hardware access through external memory (i.e. CAN)
199 #define HWACC huge // hardware access through external memory (i.e. CAN) 194#define HWACC huge // hardware access through external memory (i.e. CAN)
200 #define LARGE // functions set parameters to external data storage location 195#define LARGE // functions set parameters to external data storage location
201 196
202 // These types can be adjusted by users to match application requirements. The goal is to 197 // These types can be adjusted by users to match application requirements. The goal is to
203 // minimize code memory and maximize speed. 198 // minimize code memory and maximize speed.
204// #define GENERIC xhuge // generic pointer to point to application data 199// #define GENERIC xhuge // generic pointer to point to application data
205 #define GENERIC huge // generic pointer to point to application data 200#define GENERIC huge // generic pointer to point to application data
206 // Variables with this attribute can be located in external 201 // Variables with this attribute can be located in external
207 // or internal data memory. 202 // or internal data memory.
208 #define MEM // Memory attribute to optimize speed and code of pointer access. 203#define MEM // Memory attribute to optimize speed and code of pointer access.
209 204
210 #define REENTRANT 205#define REENTRANT
211 #define PUBLIC 206#define PUBLIC
212 207
213 #ifndef NDEBUG 208#ifndef NDEBUG
214 #include <stdio.h> // prototype printf() (for TRACE) 209#include <stdio.h> // prototype printf() (for TRACE)
215 #define TRACE printf 210#define TRACE printf
216 211
217 #define ASSERT(p) \ 212#define ASSERT(p) \
218 if (p) \ 213 if (p) \
219 { \ 214 { \
220 ; \ 215 ; \
@@ -224,213 +219,213 @@
224 PRINTF0("Assert failed: " #p " (file %s line %d)\n", __FILE__, (int) __LINE__ ); \ 219 PRINTF0("Assert failed: " #p " (file %s line %d)\n", __FILE__, (int) __LINE__ ); \
225 while (1); \ 220 while (1); \
226 } 221 }
227 #else 222#else
228 #define ASSERT(p) 223#define ASSERT(p)
229 #endif 224#endif
230 225
231//--------------------------------------------------------------------------- 226//---------------------------------------------------------------------------
232// definitions for Keil C166 227// definitions for Keil C166
233//--------------------------------------------------------------------------- 228//---------------------------------------------------------------------------
234#elif defined (__C166__) // 24.01.2005 r.d.: Keil ARM7 needs directive 'defined' 229#elif defined (__C166__) // 24.01.2005 r.d.: Keil ARM7 needs directive 'defined'
235 230
236 #define TARGET_SYSTEM _NO_OS_ 231#define TARGET_SYSTEM _NO_OS_
237 #define DEV_SYSTEM _DEV_KEIL_C16X_ 232#define DEV_SYSTEM _DEV_KEIL_C16X_
238 233
239 #pragma CODE 234#pragma CODE
240 #pragma MOD167 235#pragma MOD167
241 #pragma NOINIT 236#pragma NOINIT
242 #pragma DEBUG 237#pragma DEBUG
243 #pragma WARNINGLEVEL(3) // maximum warning level 238#pragma WARNINGLEVEL(3) // maximum warning level
244 #pragma WARNING DISABLE = 47 // warning <unreferenced parameter> = OFF 239#pragma WARNING DISABLE = 47 // warning <unreferenced parameter> = OFF
245 #pragma WARNING DISABLE = 38 // warning <empty translation unit> = OFF 240#pragma WARNING DISABLE = 38 // warning <empty translation unit> = OFF
246// #pragma WARNING DISABLE = 102 // warning <different const/volatile qualifiers> = OFF 241// #pragma WARNING DISABLE = 102 // warning <different const/volatile qualifiers> = OFF
247 #pragma WARNING DISABLE = 174 // warning <unreferenced 'static' function> = OFF 242#pragma WARNING DISABLE = 174 // warning <unreferenced 'static' function> = OFF
248 #pragma WARNING DISABLE = 183 // warning <dead assignement eliminated> = OFF 243#pragma WARNING DISABLE = 183 // warning <dead assignement eliminated> = OFF
249 244
250 #define NEAR idata // variables mapped to internal data storage location 245#define NEAR idata // variables mapped to internal data storage location
251 #define FAR xhuge // variables mapped to external data storage location 246#define FAR xhuge // variables mapped to external data storage location
252 #define CONST const // variables mapped to ROM (i.e. flash) 247#define CONST const // variables mapped to ROM (i.e. flash)
253 #define ROM // code or variables mapped to ROM (i.e. flash) 248#define ROM // code or variables mapped to ROM (i.e. flash)
254 // usage: CONST BYTE ROM foo = 0x00; 249 // usage: CONST BYTE ROM foo = 0x00;
255// #define HWACC sdata // hardware access through external memory (i.e. CAN) 250// #define HWACC sdata // hardware access through external memory (i.e. CAN)
256 #define HWACC huge // hardware access through external memory (i.e. CAN) 251#define HWACC huge // hardware access through external memory (i.e. CAN)
257 #define LARGE // functions set parameters to external data storage location 252#define LARGE // functions set parameters to external data storage location
258 253
259 // These types can be adjusted by users to match application requirements. The goal is to 254 // These types can be adjusted by users to match application requirements. The goal is to
260 // minimize code memory and maximize speed. 255 // minimize code memory and maximize speed.
261 #define GENERIC xhuge // generic pointer to point to application data 256#define GENERIC xhuge // generic pointer to point to application data
262 // Variables with this attribute can be located in external 257 // Variables with this attribute can be located in external
263 // or internal data memory. 258 // or internal data memory.
264 #define MEM // Memory attribute to optimize speed and code of pointer access. 259#define MEM // Memory attribute to optimize speed and code of pointer access.
265 260
266 #define REENTRANT 261#define REENTRANT
267 #define PUBLIC 262#define PUBLIC
268 263
269 #ifndef NDEBUG 264#ifndef NDEBUG
270 #include <stdio.h> // prototype printf() (for TRACE) 265#include <stdio.h> // prototype printf() (for TRACE)
271 #define TRACE printf 266#define TRACE printf
272 #endif 267#endif
273 268
274//--------------------------------------------------------------------------- 269//---------------------------------------------------------------------------
275// definitions for MPLAB C30 for dsPIC33F series 270// definitions for MPLAB C30 for dsPIC33F series
276//--------------------------------------------------------------------------- 271//---------------------------------------------------------------------------
277#elif defined (__C30__) 272#elif defined (__C30__)
278 273
279 #define TARGET_SYSTEM _NO_OS_ 274#define TARGET_SYSTEM _NO_OS_
280 #define DEV_SYSTEM _DEV_MPLAB_DSPIC33F_ 275#define DEV_SYSTEM _DEV_MPLAB_DSPIC33F_
281 276
282 #define NEAR // variables mapped to internal data storage location 277#define NEAR // variables mapped to internal data storage location
283 #define FAR // variables mapped to external data storage location 278#define FAR // variables mapped to external data storage location
284 #define CONST const // variables mapped to ROM (i.e. flash) 279#define CONST const // variables mapped to ROM (i.e. flash)
285 #define ROM // code or variables mapped to ROM (i.e. flash) 280#define ROM // code or variables mapped to ROM (i.e. flash)
286 // usage: CONST BYTE ROM foo = 0x00; 281 // usage: CONST BYTE ROM foo = 0x00;
287 #define HWACC // hardware access through external memory (i.e. CAN) 282#define HWACC // hardware access through external memory (i.e. CAN)
288 #define LARGE // functions set parameters to external data storage location 283#define LARGE // functions set parameters to external data storage location
289 284
290 // These types can be adjusted by users to match application requirements. The goal is to 285 // These types can be adjusted by users to match application requirements. The goal is to
291 // minimize code memory and maximize speed. 286 // minimize code memory and maximize speed.
292 #define GENERIC // generic pointer to point to application data 287#define GENERIC // generic pointer to point to application data
293 // Variables with this attribute can be located in external 288 // Variables with this attribute can be located in external
294 // or internal data memory. 289 // or internal data memory.
295 #define MEM // Memory attribute to optimize speed and code of pointer access. 290#define MEM // Memory attribute to optimize speed and code of pointer access.
296 291
297 #define REENTRANT 292#define REENTRANT
298 #define PUBLIC 293#define PUBLIC
299 294
300// #ifndef QWORD 295// #ifndef QWORD
301// #define QWORD long long 296// #define QWORD long long
302// #endif 297// #endif
303 298
304 #ifndef NDEBUG 299#ifndef NDEBUG
305 #include <stdio.h> // prototype printf() (for TRACE) 300#include <stdio.h> // prototype printf() (for TRACE)
306 #define TRACE printf 301#define TRACE printf
307 #endif 302#endif
308 303
309//--------------------------------------------------------------------------- 304//---------------------------------------------------------------------------
310// definitions for Keil ARM 305// definitions for Keil ARM
311//--------------------------------------------------------------------------- 306//---------------------------------------------------------------------------
312#elif defined (__CA__) 307#elif defined (__CA__)
313 308
314 #define TARGET_SYSTEM _NO_OS_ 309#define TARGET_SYSTEM _NO_OS_
315 #define DEV_SYSTEM _DEV_KEIL_CARM_ 310#define DEV_SYSTEM _DEV_KEIL_CARM_
316 311
317 #define NEAR // variables mapped to internal data storage location 312#define NEAR // variables mapped to internal data storage location
318 #define FAR // variables mapped to external data storage location 313#define FAR // variables mapped to external data storage location
319 #define CONST const // variables mapped to ROM (i.e. flash) 314#define CONST const // variables mapped to ROM (i.e. flash)
320 #define ROM // code or variables mapped to ROM (i.e. flash) 315#define ROM // code or variables mapped to ROM (i.e. flash)
321 // usage: CONST BYTE ROM foo = 0x00; 316 // usage: CONST BYTE ROM foo = 0x00;
322 #define HWACC // hardware access through external memory (i.e. CAN) 317#define HWACC // hardware access through external memory (i.e. CAN)
323 #define LARGE // functions set parameters to external data storage location 318#define LARGE // functions set parameters to external data storage location
324 319
325 // These types can be adjusted by users to match application requirements. The goal is to 320 // These types can be adjusted by users to match application requirements. The goal is to
326 // minimize code memory and maximize speed. 321 // minimize code memory and maximize speed.
327 #define GENERIC // generic pointer to point to application data 322#define GENERIC // generic pointer to point to application data
328 // Variables with this attribute can be located in external 323 // Variables with this attribute can be located in external
329 // or internal data memory. 324 // or internal data memory.
330 #define MEM // Memory attribute to optimize speed and code of pointer access. 325#define MEM // Memory attribute to optimize speed and code of pointer access.
331 326
332 #define REENTRANT 327#define REENTRANT
333 #define PUBLIC 328#define PUBLIC
334 329
335 #ifndef QWORD 330#ifndef QWORD
336 #define QWORD long long 331#define QWORD long long
337 #endif 332#endif
338 333
339 #ifndef NDEBUG 334#ifndef NDEBUG
340 #include <stdio.h> // prototype printf() (for TRACE) 335#include <stdio.h> // prototype printf() (for TRACE)
341 #define TRACE printf 336#define TRACE printf
342 #endif 337#endif
343 338
344//--------------------------------------------------------------------------- 339//---------------------------------------------------------------------------
345// definitions for RealView ARM compilation tools (provided by recent Keil Microcontroller Development Kits) 340// definitions for RealView ARM compilation tools (provided by recent Keil Microcontroller Development Kits)
346//--------------------------------------------------------------------------- 341//---------------------------------------------------------------------------
347#elif defined (__ARMCC_VERSION) 342#elif defined (__ARMCC_VERSION)
348 343
349 #define TARGET_SYSTEM _NO_OS_ 344#define TARGET_SYSTEM _NO_OS_
350 #define DEV_SYSTEM _DEV_RVCT_CARM_ 345#define DEV_SYSTEM _DEV_RVCT_CARM_
351 346
352 #define NEAR // variables mapped to internal data storage location 347#define NEAR // variables mapped to internal data storage location
353 #define FAR // variables mapped to external data storage location 348#define FAR // variables mapped to external data storage location
354 #define CONST const // variables mapped to ROM (i.e. flash) 349#define CONST const // variables mapped to ROM (i.e. flash)
355 #define ROM // code or variables mapped to ROM (i.e. flash) 350#define ROM // code or variables mapped to ROM (i.e. flash)
356 // usage: CONST BYTE ROM foo = 0x00; 351 // usage: CONST BYTE ROM foo = 0x00;
357 #define HWACC // hardware access through external memory (i.e. CAN) 352#define HWACC // hardware access through external memory (i.e. CAN)
358 #define LARGE // functions set parameters to external data storage location 353#define LARGE // functions set parameters to external data storage location
359 354
360 // These types can be adjusted by users to match application requirements. The goal is to 355 // These types can be adjusted by users to match application requirements. The goal is to
361 // minimize code memory and maximize speed. 356 // minimize code memory and maximize speed.
362 #define GENERIC // generic pointer to point to application data 357#define GENERIC // generic pointer to point to application data
363 // Variables with this attribute can be located in external 358 // Variables with this attribute can be located in external
364 // or internal data memory. 359 // or internal data memory.
365 #define MEM // Memory attribute to optimize speed and code of pointer access. 360#define MEM // Memory attribute to optimize speed and code of pointer access.
366 361
367 #define REENTRANT 362#define REENTRANT
368 #define PUBLIC 363#define PUBLIC
369 364
370 #ifndef QWORD 365#ifndef QWORD
371 #define QWORD long long 366#define QWORD long long
372 #endif 367#endif
373 368
374 #ifndef NDEBUG 369#ifndef NDEBUG
375 #define ASSERT(expr) if (!(expr)) {\ 370#define ASSERT(expr) if (!(expr)) {\
376 TRACE0 ("Assertion failed: " #expr );\ 371 TRACE0 ("Assertion failed: " #expr );\
377 while (1);} 372 while (1);}
378 #else 373#else
379 #define ASSERT(expr) 374#define ASSERT(expr)
380 #endif 375#endif
381 376
382 #ifndef NDEBUG 377#ifndef NDEBUG
383 #include <stdio.h> // prototype printf() (for TRACE) 378#include <stdio.h> // prototype printf() (for TRACE)
384 #define TRACE printf 379#define TRACE printf
385 #endif 380#endif
386 381
387//--------------------------------------------------------------------------- 382//---------------------------------------------------------------------------
388// definitions for ARM IAR C Compiler 383// definitions for ARM IAR C Compiler
389//--------------------------------------------------------------------------- 384//---------------------------------------------------------------------------
390#elif defined (__ICCARM__) 385#elif defined (__ICCARM__)
391 386
392 #define TARGET_SYSTEM _NO_OS_ 387#define TARGET_SYSTEM _NO_OS_
393 #define DEV_SYSTEM _DEV_IAR_CARM_ 388#define DEV_SYSTEM _DEV_IAR_CARM_
394 389
395 #define NEAR // variables mapped to internal data storage location 390#define NEAR // variables mapped to internal data storage location
396 #define FAR // variables mapped to external data storage location 391#define FAR // variables mapped to external data storage location
397 #define CONST const // variables mapped to ROM (i.e. flash) 392#define CONST const // variables mapped to ROM (i.e. flash)
398 #define ROM // code or variables mapped to ROM (i.e. flash) 393#define ROM // code or variables mapped to ROM (i.e. flash)
399 // usage: CONST BYTE ROM foo = 0x00; 394 // usage: CONST BYTE ROM foo = 0x00;
400 #define HWACC // hardware access through external memory (i.e. CAN) 395#define HWACC // hardware access through external memory (i.e. CAN)
401 #define LARGE // functions set parameters to external data storage location 396#define LARGE // functions set parameters to external data storage location
402 397
403 // These types can be adjusted by users to match application requirements. The goal is to 398 // These types can be adjusted by users to match application requirements. The goal is to
404 // minimize code memory and maximize speed. 399 // minimize code memory and maximize speed.
405 #define GENERIC // generic pointer to point to application data 400#define GENERIC // generic pointer to point to application data
406 // Variables with this attribute can be located in external 401 // Variables with this attribute can be located in external
407 // or internal data memory. 402 // or internal data memory.
408 #define MEM // Memory attribute to optimize speed and code of pointer access. 403#define MEM // Memory attribute to optimize speed and code of pointer access.
409 404
410 #define REENTRANT 405#define REENTRANT
411 #define PUBLIC 406#define PUBLIC
412 407
413 #ifndef QWORD 408#ifndef QWORD
414 #define QWORD long long 409#define QWORD long long
415 #endif 410#endif
416 411
417 // Workaround: 412 // Workaround:
418 // If we use IAR and want to debug but don't want to use C-Spy Debugger 413 // If we use IAR and want to debug but don't want to use C-Spy Debugger
419 // assert() doesn't work in debug mode because it needs support for FILE descriptors 414 // assert() doesn't work in debug mode because it needs support for FILE descriptors
420 // (_DLIB_FILE_DESCRIPTOR == 1). 415 // (_DLIB_FILE_DESCRIPTOR == 1).
421 #ifndef NDEBUG 416#ifndef NDEBUG
422 #define ASSERT(expr) if (!(expr)) {\ 417#define ASSERT(expr) if (!(expr)) {\
423 TRACE0 ("Assertion failed: " #expr );\ 418 TRACE0 ("Assertion failed: " #expr );\
424 while (1);} 419 while (1);}
425 #else 420#else
426 #define ASSERT(expr) 421#define ASSERT(expr)
427 #endif 422#endif
428 423
429 #ifndef NDEBUG 424#ifndef NDEBUG
430 #include <stdio.h> // prototype printf() (for TRACE) 425#include <stdio.h> // prototype printf() (for TRACE)
431 #define TRACE printf 426#define TRACE printf
432// #define TRACE PRINTF4 427// #define TRACE PRINTF4
433 #endif 428#endif
434 429
435//--------------------------------------------------------------------------- 430//---------------------------------------------------------------------------
436// definitions for Tasking 8051 431// definitions for Tasking 8051
@@ -438,34 +433,33 @@
438 433
439#elif defined (_CC51) 434#elif defined (_CC51)
440 435
441 #include <cc51.h> 436#include <cc51.h>
442 437
443 #define TARGET_SYSTEM _NO_OS_ 438#define TARGET_SYSTEM _NO_OS_
444 #define DEV_SYSTEM _DEV_TASKING_C51X_ 439#define DEV_SYSTEM _DEV_TASKING_C51X_
445 440
446 #define NEAR _data // variables mapped to internal data storage location 441#define NEAR _data // variables mapped to internal data storage location
447 #define FAR _xdat // variables mapped to external data storage location 442#define FAR _xdat // variables mapped to external data storage location
448 #define CONST const // variables mapped to ROM (i.e. flash) 443#define CONST const // variables mapped to ROM (i.e. flash)
449 #define ROM // code or variables mapped to ROM (i.e. flash) 444#define ROM // code or variables mapped to ROM (i.e. flash)
450 // usage: CONST BYTE ROM foo = 0x00; 445 // usage: CONST BYTE ROM foo = 0x00;
451 #define HWACC _xdat // hardware access through external memory (i.e. CAN) 446#define HWACC _xdat // hardware access through external memory (i.e. CAN)
452 #define LARGE // functions set parameters to external data storage location 447#define LARGE // functions set parameters to external data storage location
453 448
454 // These types can be adjusted by users to match application requirements. The goal is to 449 // These types can be adjusted by users to match application requirements. The goal is to
455 // minimize code memory and maximize speed. 450 // minimize code memory and maximize speed.
456 #define GENERIC // generic pointer to point to application data 451#define GENERIC // generic pointer to point to application data
457 // Variables with this attribute can be located in external 452 // Variables with this attribute can be located in external
458 // or internal data memory. 453 // or internal data memory.
459 #define MEM _xdat // Memory attribute to optimize speed and code of pointer access. 454#define MEM _xdat // Memory attribute to optimize speed and code of pointer access.
460
461 #define REENTRANT _reentrant
462 #define PUBLIC
463 455
464 #ifndef NDEBUG 456#define REENTRANT _reentrant
465 #include <stdio.h> // prototype printf() (for TRACE) 457#define PUBLIC
466 #define TRACE printf
467 #endif
468 458
459#ifndef NDEBUG
460#include <stdio.h> // prototype printf() (for TRACE)
461#define TRACE printf
462#endif
469 463
470//--------------------------------------------------------------------------- 464//---------------------------------------------------------------------------
471// definitions for Tasking C167CR and C164CI 465// definitions for Tasking C167CR and C164CI
@@ -473,35 +467,34 @@
473 467
474#elif defined (_C166) 468#elif defined (_C166)
475 469
476 #define TARGET_SYSTEM _NO_OS_ 470#define TARGET_SYSTEM _NO_OS_
477 #define DEV_SYSTEM _DEV_TASKING_C16X_ 471#define DEV_SYSTEM _DEV_TASKING_C16X_
478 472
479 #define NEAR near // variables mapped to internal data storage location 473#define NEAR near // variables mapped to internal data storage location
480 #define FAR far // variables mapped to external data storage location 474#define FAR far // variables mapped to external data storage location
481 #define CONST const // variables mapped to ROM (i.e. flash) 475#define CONST const // variables mapped to ROM (i.e. flash)
482 #define ROM // code or variables mapped to ROM (i.e. flash) 476#define ROM // code or variables mapped to ROM (i.e. flash)
483 // usage: CONST BYTE ROM foo = 0x00; 477 // usage: CONST BYTE ROM foo = 0x00;
484 #define HWACC /* to be defined */ // hardware access through external memory (i.e. CAN) 478#define HWACC /* to be defined */ // hardware access through external memory (i.e. CAN)
485 #define LARGE // functions set parameters to external data storage location 479#define LARGE // functions set parameters to external data storage location
486 480
487 // These types can be adjusted by users to match application requirements. The goal is to 481 // These types can be adjusted by users to match application requirements. The goal is to
488 // minimize code memory and maximize speed. 482 // minimize code memory and maximize speed.
489 #define GENERIC // generic pointer to point to application data 483#define GENERIC // generic pointer to point to application data
490 // Variables with this attribute can be located in external 484 // Variables with this attribute can be located in external
491 // or internal data memory. 485 // or internal data memory.
492 #define MEM // Memory attribute to optimize speed and code of pointer access. 486#define MEM // Memory attribute to optimize speed and code of pointer access.
493 487
494 #define REENTRANT 488#define REENTRANT
495 #define PUBLIC 489#define PUBLIC
496 490
497 // Stdio.h has to be alway included here. If printf() is used stdio.h defines NULL 491 // Stdio.h has to be alway included here. If printf() is used stdio.h defines NULL
498 // without checking if it is already included. So an error occurs while compiling. 492 // without checking if it is already included. So an error occurs while compiling.
499 // (r.d.) 493 // (r.d.)
500 #include <stdio.h> // prototype printf() (for TRACE) 494#include <stdio.h> // prototype printf() (for TRACE)
501 #ifndef NDEBUG 495#ifndef NDEBUG
502 #define TRACE printf 496#define TRACE printf
503 #endif 497#endif
504
505 498
506//--------------------------------------------------------------------------- 499//---------------------------------------------------------------------------
507// definitions for FUJITSU FFMC-16LX MB90590 500// definitions for FUJITSU FFMC-16LX MB90590
@@ -510,34 +503,33 @@
510//#elif (defined (F590) || defined (F543) || defined (F598) || defined (F495) || defined (F350)) 503//#elif (defined (F590) || defined (F543) || defined (F598) || defined (F495) || defined (F350))
511#elif defined(__COMPILER_FCC907__) 504#elif defined(__COMPILER_FCC907__)
512 505
513 #define TARGET_SYSTEM _NO_OS_ 506#define TARGET_SYSTEM _NO_OS_
514 #define DEV_SYSTEM _DEV_FUJITSU_F590_ 507#define DEV_SYSTEM _DEV_FUJITSU_F590_
515 508
516 #define NEAR /* to be defined */ // variables mapped to internal data storage location 509#define NEAR /* to be defined */ // variables mapped to internal data storage location
517 #define FAR /* to be defined */ // variables mapped to external data storage location 510#define FAR /* to be defined */ // variables mapped to external data storage location
518 #define CONST const // variables mapped to ROM (i.e. flash) 511#define CONST const // variables mapped to ROM (i.e. flash)
519 #define ROM /* to be defined */ // code or variables mapped to ROM (i.e. flash) 512#define ROM /* to be defined */ // code or variables mapped to ROM (i.e. flash)
520 // usage: CONST BYTE ROM foo = 0x00; 513 // usage: CONST BYTE ROM foo = 0x00;
521 #define HWACC /* to be defined */ // hardware access through external memory (i.e. CAN) 514#define HWACC /* to be defined */ // hardware access through external memory (i.e. CAN)
522 #define LARGE // functions set parameters to external data storage location 515#define LARGE // functions set parameters to external data storage location
523 516
524 // These types can be adjusted by users to match application requirements. The goal is to 517 // These types can be adjusted by users to match application requirements. The goal is to
525 // minimize code memory and maximize speed. 518 // minimize code memory and maximize speed.
526 #define GENERIC // generic pointer to point to application data 519#define GENERIC // generic pointer to point to application data
527 // Variables with this attribute can be located in external 520 // Variables with this attribute can be located in external
528 // or internal data memory. 521 // or internal data memory.
529 #define MEM // Memory attribute to optimize speed and code of pointer access. 522#define MEM // Memory attribute to optimize speed and code of pointer access.
530 523
531 // softune is not able to support 64 bit variables QWORD !!! 524 // softune is not able to support 64 bit variables QWORD !!!
532 525
533 #define REENTRANT 526#define REENTRANT
534 #define PUBLIC 527#define PUBLIC
535
536 #ifndef NDEBUG
537 #include <stdio.h> // prototype printf() (for TRACE)
538 #define TRACE printf
539 #endif
540 528
529#ifndef NDEBUG
530#include <stdio.h> // prototype printf() (for TRACE)
531#define TRACE printf
532#endif
541 533
542//--------------------------------------------------------------------------- 534//---------------------------------------------------------------------------
543// definitions for Mitsubishi M16C family for TASKING Compiler CM16 535// definitions for Mitsubishi M16C family for TASKING Compiler CM16
@@ -545,36 +537,35 @@
545 537
546#elif defined (_CM16C) 538#elif defined (_CM16C)
547 539
548 #define TARGET_SYSTEM _NO_OS_ 540#define TARGET_SYSTEM _NO_OS_
549 #define DEV_SYSTEM _DEV_TASKING_M16C_ 541#define DEV_SYSTEM _DEV_TASKING_M16C_
550 542
551 #define NEAR _near // variables mapped to internal data storage location 543#define NEAR _near // variables mapped to internal data storage location
552 #define FAR _far // variables mapped to external data storage location 544#define FAR _far // variables mapped to external data storage location
553 #define CONST _farrom // variables mapped to ROM (i.e. flash) 545#define CONST _farrom // variables mapped to ROM (i.e. flash)
554 #define ROM // code or variables mapped to ROM (i.e. flash) 546#define ROM // code or variables mapped to ROM (i.e. flash)
555 // usage: CONST BYTE ROM foo = 0x00; 547 // usage: CONST BYTE ROM foo = 0x00;
556 #define HWACC _near // hardware access through external memory (i.e. CAN) 548#define HWACC _near // hardware access through external memory (i.e. CAN)
557 #define LARGE // functions set parameters to external data storage location 549#define LARGE // functions set parameters to external data storage location
558 550
559 // These types can be adjusted by users to match application requirements. The goal is to 551 // These types can be adjusted by users to match application requirements. The goal is to
560 // minimize code memory and maximize speed. 552 // minimize code memory and maximize speed.
561 #define GENERIC _far // generic pointer to point to application data 553#define GENERIC _far // generic pointer to point to application data
562 // Variables with this attribute can be located in external 554 // Variables with this attribute can be located in external
563 // or internal data memory. 555 // or internal data memory.
564 // do you use memory model SMALL, than you have to set _far 556 // do you use memory model SMALL, than you have to set _far
565 #define MEM // Memory attribute to optimize speed and code of pointer access. 557#define MEM // Memory attribute to optimize speed and code of pointer access.
566 558
567 #define REENTRANT 559#define REENTRANT
568 #define PUBLIC 560#define PUBLIC
569 561
570 // Stdio.h has to be alway included here. If printf() is used stdio.h defines NULL 562 // Stdio.h has to be alway included here. If printf() is used stdio.h defines NULL
571 // without checking if it is already included. So an error occurs while compiling. 563 // without checking if it is already included. So an error occurs while compiling.
572 // (r.d.) 564 // (r.d.)
573 #include <stdio.h> // prototype printf() (for TRACE) 565#include <stdio.h> // prototype printf() (for TRACE)
574 #ifndef NDEBUG 566#ifndef NDEBUG
575 #define TRACE printf 567#define TRACE printf
576 #endif 568#endif
577
578 569
579//--------------------------------------------------------------------------- 570//---------------------------------------------------------------------------
580// definitions for Mitsubishi M16C family for Mitsubishi Compiler NC30 571// definitions for Mitsubishi M16C family for Mitsubishi Compiler NC30
@@ -582,61 +573,61 @@
582// name NC30, andere Form will der Compiler nicht !! 573// name NC30, andere Form will der Compiler nicht !!
583#elif defined (NC30) 574#elif defined (NC30)
584 575
585 #define TARGET_SYSTEM _NO_OS_ 576#define TARGET_SYSTEM _NO_OS_
586 #define DEV_SYSTEM _DEV_MITSUBISHI_M16C_ 577#define DEV_SYSTEM _DEV_MITSUBISHI_M16C_
587 578
588 #define NEAR near // variables mapped to internal data storage location 579#define NEAR near // variables mapped to internal data storage location
589 #define FAR far // variables mapped to external data storage location 580#define FAR far // variables mapped to external data storage location
590 #define CONST const // variables mapped to ROM (i.e. flash) 581#define CONST const // variables mapped to ROM (i.e. flash)
591 #define ROM // code or variables mapped to ROM (i.e. flash) 582#define ROM // code or variables mapped to ROM (i.e. flash)
592 // usage: CONST BYTE ROM foo = 0x00; 583 // usage: CONST BYTE ROM foo = 0x00;
593 #define HWACC near // hardware access through external memory (i.e. CAN) 584#define HWACC near // hardware access through external memory (i.e. CAN)
594 #define LARGE // functions set parameters to external data storage location 585#define LARGE // functions set parameters to external data storage location
595 586
596 // These types can be adjusted by users to match application requirements. The goal is to 587 // These types can be adjusted by users to match application requirements. The goal is to
597 // minimize code memory and maximize speed. 588 // minimize code memory and maximize speed.
598 #define GENERIC far // generic pointer to point to application data 589#define GENERIC far // generic pointer to point to application data
599 // Variables with this attribute can be located in external 590 // Variables with this attribute can be located in external
600 // or internal data memory. 591 // or internal data memory.
601 #define MEM // Memory attribute to optimize speed and code of pointer access. 592#define MEM // Memory attribute to optimize speed and code of pointer access.
602 593
603 #define REENTRANT 594#define REENTRANT
604 #define PUBLIC 595#define PUBLIC
605 596
606 #ifndef NDEBUG 597#ifndef NDEBUG
607 #include <stdio.h> // prototype printf() (for TRACE) 598#include <stdio.h> // prototype printf() (for TRACE)
608 #define TRACE printf 599#define TRACE printf
609 #endif 600#endif
610 601
611//--------------------------------------------------------------------------- 602//---------------------------------------------------------------------------
612// definitions for Renesas M32C family for Renesas Compiler 603// definitions for Renesas M32C family for Renesas Compiler
613//--------------------------------------------------------------------------- 604//---------------------------------------------------------------------------
614#elif defined (NC308) 605#elif defined (NC308)
615 606
616 #define TARGET_SYSTEM _NO_OS_ 607#define TARGET_SYSTEM _NO_OS_
617 #define DEV_SYSTEM _DEV_RENESAS_M32C_ 608#define DEV_SYSTEM _DEV_RENESAS_M32C_
618 609
619 #define NEAR near // variables mapped to internal data storage location 610#define NEAR near // variables mapped to internal data storage location
620 #define FAR far // variables mapped to external data storage location 611#define FAR far // variables mapped to external data storage location
621 #define CONST const // variables mapped to ROM (i.e. flash) 612#define CONST const // variables mapped to ROM (i.e. flash)
622 #define ROM // code or variables mapped to ROM (i.e. flash) 613#define ROM // code or variables mapped to ROM (i.e. flash)
623 #define HWACC // hardware access through external memory (i.e. CAN) 614#define HWACC // hardware access through external memory (i.e. CAN)
624 #define LARGE // functions set parameters to external data storage location 615#define LARGE // functions set parameters to external data storage location
625 616
626 // These types can be adjusted by users to match application requirements. The goal is to 617 // These types can be adjusted by users to match application requirements. The goal is to
627 // minimize code memory and maximize speed. 618 // minimize code memory and maximize speed.
628 #define GENERIC // generic pointer to point to application data 619#define GENERIC // generic pointer to point to application data
629 // Variables with this attribute can be located in external 620 // Variables with this attribute can be located in external
630 // or internal data memory. 621 // or internal data memory.
631 #define MEM far // Memory attribute to optimize speed and code of pointer access. 622#define MEM far // Memory attribute to optimize speed and code of pointer access.
632 623
633 #define REENTRANT 624#define REENTRANT
634 #define PUBLIC 625#define PUBLIC
635 626
636 #ifndef NDEBUG 627#ifndef NDEBUG
637 #include <stdio.h> // prototype printf() (for TRACE) 628#include <stdio.h> // prototype printf() (for TRACE)
638 #define TRACE printf 629#define TRACE printf
639 #endif 630#endif
640 631
641// #error ("RENESAS o.k.") 632// #error ("RENESAS o.k.")
642 633
@@ -646,37 +637,36 @@
646 637
647#elif defined(__GNUC__) && defined(__arm__) && !defined(__LINUX_ARM_ARCH__) 638#elif defined(__GNUC__) && defined(__arm__) && !defined(__LINUX_ARM_ARCH__)
648 639
649 #define TARGET_SYSTEM _NO_OS_ 640#define TARGET_SYSTEM _NO_OS_
650 #define DEV_SYSTEM _DEV_GNU_ARM7_ 641#define DEV_SYSTEM _DEV_GNU_ARM7_
651 642
652 #define NEAR // variables mapped to internal data storage location 643#define NEAR // variables mapped to internal data storage location
653 #define FAR // variables mapped to external data storage location 644#define FAR // variables mapped to external data storage location
654 #define CONST const // variables mapped to ROM (i.e. flash) 645#define CONST const // variables mapped to ROM (i.e. flash)
655 #define ROM // code or variables mapped to ROM (i.e. flash) 646#define ROM // code or variables mapped to ROM (i.e. flash)
656 // usage: CONST BYTE ROM foo = 0x00; 647 // usage: CONST BYTE ROM foo = 0x00;
657 #define HWACC // hardware access through external memory (i.e. CAN) 648#define HWACC // hardware access through external memory (i.e. CAN)
658 #define LARGE // functions set parameters to external data storage location 649#define LARGE // functions set parameters to external data storage location
659 650
660 // These types can be adjusted by users to match application requirements. The goal is to 651 // These types can be adjusted by users to match application requirements. The goal is to
661 // minimize code memory and maximize speed. 652 // minimize code memory and maximize speed.
662 #define GENERIC // generic pointer to point to application data 653#define GENERIC // generic pointer to point to application data
663 // Variables with this attribute can be located in external 654 // Variables with this attribute can be located in external
664 // or internal data memory. 655 // or internal data memory.
665 #define MEM // Memory attribute to optimize speed and code of pointer access. 656#define MEM // Memory attribute to optimize speed and code of pointer access.
666 #define HWACC // hardware access through external memory (i.e. CAN) 657#define HWACC // hardware access through external memory (i.e. CAN)
667
668 #define REENTRANT
669 #define PUBLIC
670 658
671 #ifndef QWORD 659#define REENTRANT
672 #define QWORD long long // i.A. durch Herr Kuschel 660#define PUBLIC
673 #endif
674 661
675 #ifndef NDEBUG 662#ifndef QWORD
676 #include <stdio.h> // prototype printf() (for TRACE) 663#define QWORD long long // i.A. durch Herr Kuschel
677 #define TRACE printf 664#endif
678 #endif
679 665
666#ifndef NDEBUG
667#include <stdio.h> // prototype printf() (for TRACE)
668#define TRACE printf
669#endif
680 670
681//--------------------------------------------------------------------------- 671//---------------------------------------------------------------------------
682// definitions for Motorola PowerPC family 5x5 (555/565) 672// definitions for Motorola PowerPC family 5x5 (555/565)
@@ -685,261 +675,253 @@
685 675
686#elif defined (__GNUC__) 676#elif defined (__GNUC__)
687 677
688 #if defined (LINUX) || defined (linux) || defined (__linux__) 678#if defined (LINUX) || defined (linux) || defined (__linux__)
689 #define LINUX_SYSTEM // define 'LINUX_SYSTEM' uniform for all Linux based systems 679#define LINUX_SYSTEM // define 'LINUX_SYSTEM' uniform for all Linux based systems
690 // r.d.: We will need an other solution here! There are two sections here which do check the preproc-definitions: 680 // r.d.: We will need an other solution here! There are two sections here which do check the preproc-definitions:
691 // LINUX and __linux__ . The first one was Linux for PC, the second one is this section for embedded Linux (MCF5xxx). 681 // LINUX and __linux__ . The first one was Linux for PC, the second one is this section for embedded Linux (MCF5xxx).
692 // But Linux for PC does not need the definitions for embedded Linux. 682 // But Linux for PC does not need the definitions for embedded Linux.
693 #endif 683#endif
694 684
695 // GNU C compiler supports function inlining 685 // GNU C compiler supports function inlining
696 #define INLINE_FUNCTION_DEF extern inline 686#define INLINE_FUNCTION_DEF extern inline
697 687
698 // to actually enable inlining just include the following three lines 688 // to actually enable inlining just include the following three lines
699 // #undef INLINE_FUNCTION 689 // #undef INLINE_FUNCTION
700 // #define INLINE_FUNCTION INLINE_FUNCTION_DEF 690 // #define INLINE_FUNCTION INLINE_FUNCTION_DEF
701 // #define INLINE_ENABLED TRUE 691 // #define INLINE_ENABLED TRUE
702 692
703 #ifdef PXROS 693#ifdef PXROS
704 #define TARGET_SYSTEM _PXROS_ 694#define TARGET_SYSTEM _PXROS_
705 #ifdef __i386__ 695#ifdef __i386__
706 #undef LINUX // this define seems to be set from compiler 696#undef LINUX // this define seems to be set from compiler
707 #define DEV_SYSTEM _DEV_HIGHTEC_X86_ 697#define DEV_SYSTEM _DEV_HIGHTEC_X86_
708 #elif defined (__tricore__) 698#elif defined (__tricore__)
709 #define DEV_SYSTEM _DEV_GNU_TRICORE_ 699#define DEV_SYSTEM _DEV_GNU_TRICORE_
710 #else // MPC5x5 700#else // MPC5x5
711 #define DEV_SYSTEM _DEV_GNU_MPC5X5_ 701#define DEV_SYSTEM _DEV_GNU_MPC5X5_
712 #endif 702#endif
713
714 #elif defined (LINUX) || defined (__linux__)
715 #define TARGET_SYSTEM _LINUX_ // Linux definition
716 #define DEV_SYSTEM _DEV_LINUX_
717
718 #elif defined (GNU_CF5282)
719 #define TARGET_SYSTEM _NO_OS_
720 #define DEV_SYSTEM _DEV_GNU_CF5282_
721 703
722 #elif defined (ECOSPRO_I386_PEAK_PCI) 704#elif defined (LINUX) || defined (__linux__)
723 #define TARGET_SYSTEM _ECOSPRO_ 705#define TARGET_SYSTEM _LINUX_ // Linux definition
724 #define DEV_SYSTEM _DEV_GNU_I386_ 706#define DEV_SYSTEM _DEV_LINUX_
725 707
726 #elif defined (GNU_CF548X) 708#elif defined (GNU_CF5282)
727 #define TARGET_SYSTEM _NO_OS_ 709#define TARGET_SYSTEM _NO_OS_
728 #define DEV_SYSTEM _DEV_GNU_CF548X_ 710#define DEV_SYSTEM _DEV_GNU_CF5282_
729 #else
730 #error 'ERROR: DEV_SYSTEM not found!'
731 #endif
732 711
712#elif defined (ECOSPRO_I386_PEAK_PCI)
713#define TARGET_SYSTEM _ECOSPRO_
714#define DEV_SYSTEM _DEV_GNU_I386_
733 715
734 #ifndef QWORD 716#elif defined (GNU_CF548X)
735 #define QWORD long long int 717#define TARGET_SYSTEM _NO_OS_
736 #endif 718#define DEV_SYSTEM _DEV_GNU_CF548X_
719#else
720#error 'ERROR: DEV_SYSTEM not found!'
721#endif
737 722
738 #if (TARGET_SYSTEM == _PXROS_) 723#ifndef QWORD
724#define QWORD long long int
725#endif
739 726
740 #ifndef __KERNEL__ 727#if (TARGET_SYSTEM == _PXROS_)
741 #include <string.h>
742 #endif
743 728
729#ifndef __KERNEL__
730#include <string.h>
731#endif
744 732
745 #define NEAR // variables mapped to internal data storage location 733#define NEAR // variables mapped to internal data storage location
746 #define FAR // variables mapped to external data storage location 734#define FAR // variables mapped to external data storage location
747 #define CONST const // variables mapped to ROM (i.e. flash) 735#define CONST const // variables mapped to ROM (i.e. flash)
748 #define ROM /* to be defined */ // code or variables mapped to ROM (i.e. flash) 736#define ROM /* to be defined */ // code or variables mapped to ROM (i.e. flash)
749 // usage: CONST BYTE ROM foo = 0x00; 737 // usage: CONST BYTE ROM foo = 0x00;
750 #define LARGE // functions set parameters to external data storage location 738#define LARGE // functions set parameters to external data storage location
751 739
752 // These types can be adjusted by users to match application requirements. The goal is to 740 // These types can be adjusted by users to match application requirements. The goal is to
753 // minimize code memory and maximize speed. 741 // minimize code memory and maximize speed.
754 #define GENERIC // generic pointer to point to application data 742#define GENERIC // generic pointer to point to application data
755 // Variables with this attribute can be located in external 743 // Variables with this attribute can be located in external
756 // or internal data memory. 744 // or internal data memory.
757 #define MEM // Memory attribute to optimize speed and code of pointer access. 745#define MEM // Memory attribute to optimize speed and code of pointer access.
758 746
759 #define HWACC // hardware access through external memory (i.e. CAN) 747#define HWACC // hardware access through external memory (i.e. CAN)
760 748
761 #define REENTRANT 749#define REENTRANT
762 #define PUBLIC 750#define PUBLIC
763 751
764 #ifndef QWORD 752#ifndef QWORD
765 #define QWORD long long int 753#define QWORD long long int
766 #endif 754#endif
767 755
768 #ifndef NDEBUG 756#ifndef NDEBUG
769 #include <stdio.h> // prototype printf() (for TRACE) 757#include <stdio.h> // prototype printf() (for TRACE)
770 #define TRACE printf 758#define TRACE printf
771 #endif 759#endif
772 760
773 #endif 761#endif
774 762
775 // ------------------ GNUC for I386 --------------------------------------------- 763 // ------------------ GNUC for I386 ---------------------------------------------
776 764
777 #if (TARGET_SYSTEM == _LINUX_) || (TARGET_SYSTEM == _ECOSPRO_) 765#if (TARGET_SYSTEM == _LINUX_) || (TARGET_SYSTEM == _ECOSPRO_)
778 766
779 #ifndef __KERNEL__ 767#ifndef __KERNEL__
780 #include <string.h> 768#include <string.h>
781 #endif 769#endif
782 770
783 #define ROM // code or variables mapped to ROM (i.e. flash) 771#define ROM // code or variables mapped to ROM (i.e. flash)
784 // usage: CONST BYTE ROM foo = 0x00; 772 // usage: CONST BYTE ROM foo = 0x00;
785 #define HWACC // hardware access through external memory (i.e. CAN) 773#define HWACC // hardware access through external memory (i.e. CAN)
786 774
787 // These types can be adjusted by users to match application requirements. The goal is to 775 // These types can be adjusted by users to match application requirements. The goal is to
788 // minimize code memory and maximize speed. 776 // minimize code memory and maximize speed.
789 #define GENERIC // generic pointer to point to application data 777#define GENERIC // generic pointer to point to application data
790 // Variables with this attribute can be located in external 778 // Variables with this attribute can be located in external
791 // or internal data memory. 779 // or internal data memory.
792 #define MEM // Memory attribute to optimize speed and code of pointer access. 780#define MEM // Memory attribute to optimize speed and code of pointer access.
793 781
794 #ifndef NEAR 782#ifndef NEAR
795 #define NEAR // variables mapped to internal data storage location 783#define NEAR // variables mapped to internal data storage location
796 #endif 784#endif
797 785
798 #ifndef FAR 786#ifndef FAR
799 #define FAR // variables mapped to external data storage location 787#define FAR // variables mapped to external data storage location
800 #endif 788#endif
801 789
802 #ifndef CONST 790#ifndef CONST
803 #define CONST const // variables mapped to ROM (i.e. flash) 791#define CONST const // variables mapped to ROM (i.e. flash)
804 #endif 792#endif
805 793
806 #define LARGE 794#define LARGE
807 795
808 #define REENTRANT 796#define REENTRANT
809 #define PUBLIC 797#define PUBLIC
810 798
811 #ifndef NDEBUG 799#ifndef NDEBUG
812 #ifndef __KERNEL__ 800#ifndef __KERNEL__
813 #include <stdio.h> // prototype printf() (for TRACE) 801#include <stdio.h> // prototype printf() (for TRACE)
814 #define TRACE printf 802#define TRACE printf
815 #else 803#else
816 #define TRACE printk 804#define TRACE printk
817 #endif 805#endif
818 #endif 806#endif
819 #endif 807#endif
820 808
821 // ------------------ GNU without OS --------------------------------------------- 809 // ------------------ GNU without OS ---------------------------------------------
822 810
823 #if (TARGET_SYSTEM == _NO_OS_) 811#if (TARGET_SYSTEM == _NO_OS_)
824 812
825 #define ROM // code or variables mapped to ROM (i.e. flash) 813#define ROM // code or variables mapped to ROM (i.e. flash)
826 // usage: CONST BYTE ROM foo = 0x00; 814 // usage: CONST BYTE ROM foo = 0x00;
827 #define HWACC // hardware access through external memory (i.e. CAN) 815#define HWACC // hardware access through external memory (i.e. CAN)
828 816
829 // These types can be adjusted by users to match application requirements. The goal is to 817 // These types can be adjusted by users to match application requirements. The goal is to
830 // minimize code memory and maximize speed. 818 // minimize code memory and maximize speed.
831 #define GENERIC // generic pointer to point to application data 819#define GENERIC // generic pointer to point to application data
832 // Variables with this attribute can be located in external 820 // Variables with this attribute can be located in external
833 // or internal data memory. 821 // or internal data memory.
834 #define MEM // Memory attribute to optimize speed and code of pointer access. 822#define MEM // Memory attribute to optimize speed and code of pointer access.
835 823
836 #ifndef NEAR 824#ifndef NEAR
837 #define NEAR // variables mapped to internal data storage location 825#define NEAR // variables mapped to internal data storage location
838 #endif 826#endif
839 827
840 #ifndef FAR 828#ifndef FAR
841 #define FAR // variables mapped to external data storage location 829#define FAR // variables mapped to external data storage location
842 #endif 830#endif
843 831
844 #ifndef CONST 832#ifndef CONST
845 #define CONST const // variables mapped to ROM (i.e. flash) 833#define CONST const // variables mapped to ROM (i.e. flash)
846 #endif 834#endif
847 835
848 #define LARGE 836#define LARGE
849 837
850 #define REENTRANT 838#define REENTRANT
851 #define PUBLIC 839#define PUBLIC
852 840
853 #ifndef NDEBUG 841#ifndef NDEBUG
854// #include "xuartdrv.h" 842// #include "xuartdrv.h"
855// #include <stdio.h> // prototype printf() (for TRACE) 843// #include <stdio.h> // prototype printf() (for TRACE)
856 #define TRACE printf 844#define TRACE printf
857// #define TRACE mprintf 845// #define TRACE mprintf
858// #ifndef TRACE 846// #ifndef TRACE
859// #define TRACE trace 847// #define TRACE trace
860// void trace (char *fmt, ...); 848// void trace (char *fmt, ...);
861// #endif 849// #endif
862 #endif 850#endif
863 851
864 #endif 852#endif
865 853
866//--------------------------------------------------------------------------- 854//---------------------------------------------------------------------------
867// definitions for MPC565 855// definitions for MPC565
868//--------------------------------------------------------------------------- 856//---------------------------------------------------------------------------
869#elif __MWERKS__ 857#elif __MWERKS__
870 858
871
872#ifdef __MC68K__ 859#ifdef __MC68K__
873 860
874 #define TARGET_SYSTEM = _MCF548X_ 861#define TARGET_SYSTEM = _MCF548X_
875 #define DEV_SYSTEM _DEV_MCW_MCF5XXX_ 862#define DEV_SYSTEM _DEV_MCW_MCF5XXX_
876 863
877#else 864#else
878 #define TARGET_SYSTEM = _MPC565_ 865#define TARGET_SYSTEM = _MPC565_
879 #define DEV_SYSTEM _DEV_MCW_MPC5X5_ 866#define DEV_SYSTEM _DEV_MCW_MPC5X5_
880#endif 867#endif
881 868
882 #define NEAR // variables mapped to internal data storage location 869#define NEAR // variables mapped to internal data storage location
883 #define FAR // variables mapped to external data storage location 870#define FAR // variables mapped to external data storage location
884 #define CONST const // variables mapped to ROM (i.e. flash) 871#define CONST const // variables mapped to ROM (i.e. flash)
885 #define ROM // code or variables mapped to ROM (i.e. flash) 872#define ROM // code or variables mapped to ROM (i.e. flash)
886 // usage: CONST BYTE ROM foo = 0x00; 873 // usage: CONST BYTE ROM foo = 0x00;
887 #define LARGE // functions set parameters to external data storage location 874#define LARGE // functions set parameters to external data storage location
888 875
889 // These types can be adjusted by users to match application requirements. The goal is to 876 // These types can be adjusted by users to match application requirements. The goal is to
890 // minimize code memory and maximize speed. 877 // minimize code memory and maximize speed.
891 #define GENERIC // generic pointer to point to application data 878#define GENERIC // generic pointer to point to application data
892 // Variables with this attribute can be located in external 879 // Variables with this attribute can be located in external
893 // or internal data memory. 880 // or internal data memory.
894 #define MEM // Memory attribute to optimize speed and code of pointer access. 881#define MEM // Memory attribute to optimize speed and code of pointer access.
895 882
896 #define HWACC // hardware access through external memory (i.e. CAN) 883#define HWACC // hardware access through external memory (i.e. CAN)
897 884
898 #define REENTRANT 885#define REENTRANT
899 #define PUBLIC 886#define PUBLIC
900 887
901 #ifndef NDEBUG 888#ifndef NDEBUG
902 #include <stdio.h> // prototype printf() (for TRACE) 889#include <stdio.h> // prototype printf() (for TRACE)
903 #define TRACE printf 890#define TRACE printf
904 #endif 891#endif
905 892
906//--------------------------------------------------------------------------- 893//---------------------------------------------------------------------------
907// definitions for BECK 1x3 894// definitions for BECK 1x3
908//--------------------------------------------------------------------------- 895//---------------------------------------------------------------------------
909#elif defined (__BORLANDC__) && defined (__PARADIGM__) 896#elif defined (__BORLANDC__) && defined (__PARADIGM__)
910 897
898#define TARGET_SYSTEM _NO_OS_
899#define DEV_SYSTEM _DEV_PAR_BECK1X3_
911 900
912 #define TARGET_SYSTEM _NO_OS_ 901#define ROM // code or variables mapped to ROM (i.e. flash)
913 #define DEV_SYSTEM _DEV_PAR_BECK1X3_ 902 // usage: CONST BYTE ROM foo = 0x00;
914 903#define HWACC // hardware access through external memory (i.e. CAN)
915
916
917 #define ROM // code or variables mapped to ROM (i.e. flash)
918 // usage: CONST BYTE ROM foo = 0x00;
919 #define HWACC // hardware access through external memory (i.e. CAN)
920 904
921 // These types can be adjusted by users to match application requirements. The goal is to 905 // These types can be adjusted by users to match application requirements. The goal is to
922 // minimize code memory and maximize speed. 906 // minimize code memory and maximize speed.
923 #define GENERIC // generic pointer to point to application data 907#define GENERIC // generic pointer to point to application data
924 // Variables with this attribute can be located in external 908 // Variables with this attribute can be located in external
925 // or internal data memory. 909 // or internal data memory.
926 #define MEM // Memory attribute to optimize speed and code of pointer access. 910#define MEM // Memory attribute to optimize speed and code of pointer access.
927 #define NEAR __near // variables mapped to internal data storage location 911#define NEAR __near // variables mapped to internal data storage location
928 #define FAR __far // variables mapped to external data storage location 912#define FAR __far // variables mapped to external data storage location
929 #define CONST const // variables mapped to ROM (i.e. flash) 913#define CONST const // variables mapped to ROM (i.e. flash)
930 #define LARGE 914#define LARGE
931 915
932 #define REENTRANT 916#define REENTRANT
933 #define PUBLIC 917#define PUBLIC
934
935 #ifndef NDEBUG
936 #ifndef TRACE
937 #include <stdio.h>
938 #define TRACE printf
939 #endif
940 #endif
941
942 918
919#ifndef NDEBUG
920#ifndef TRACE
921#include <stdio.h>
922#define TRACE printf
923#endif
924#endif
943 925
944//--------------------------------------------------------------------------- 926//---------------------------------------------------------------------------
945// definitions for PC 927// definitions for PC
@@ -949,113 +931,111 @@
949 931
950 // ------------------ definition target system -------------------------- 932 // ------------------ definition target system --------------------------
951 933
952 #ifdef _WIN32 934#ifdef _WIN32
953 #define TARGET_SYSTEM _WIN32_ // WIN32 definition 935#define TARGET_SYSTEM _WIN32_ // WIN32 definition
954 #define DEV_SYSTEM _DEV_WIN32_ 936#define DEV_SYSTEM _DEV_WIN32_
955 #else 937#else
956 #define TARGET_SYSTEM _DOS_ 938#define TARGET_SYSTEM _DOS_
957 #define DEV_SYSTEM _DEV_BORLAND_DOS_ 939#define DEV_SYSTEM _DEV_BORLAND_DOS_
958 #endif 940#endif
959
960 941
961 // ------------------ WIN32 --------------------------------------------- 942 // ------------------ WIN32 ---------------------------------------------
962 943
963 #if (TARGET_SYSTEM == _WIN32_) 944#if (TARGET_SYSTEM == _WIN32_)
964 945
965 #define ROM // code or variables mapped to ROM (i.e. flash) 946#define ROM // code or variables mapped to ROM (i.e. flash)
966 // usage: CONST BYTE ROM foo = 0x00; 947 // usage: CONST BYTE ROM foo = 0x00;
967 #define HWACC // hardware access through external memory (i.e. CAN) 948#define HWACC // hardware access through external memory (i.e. CAN)
968 949
969 // These types can be adjusted by users to match application requirements. The goal is to 950 // These types can be adjusted by users to match application requirements. The goal is to
970 // minimize code memory and maximize speed. 951 // minimize code memory and maximize speed.
971 #define GENERIC // generic pointer to point to application data 952#define GENERIC // generic pointer to point to application data
972 // Variables with this attribute can be located in external 953 // Variables with this attribute can be located in external
973 // or internal data memory. 954 // or internal data memory.
974 #define MEM // Memory attribute to optimize speed and code of pointer access. 955#define MEM // Memory attribute to optimize speed and code of pointer access.
975 956
976 #ifndef NEAR 957#ifndef NEAR
977 #define NEAR // variables mapped to internal data storage location 958#define NEAR // variables mapped to internal data storage location
978 #endif 959#endif
979 960
980 #ifndef FAR 961#ifndef FAR
981 #define FAR // variables mapped to external data storage location 962#define FAR // variables mapped to external data storage location
982 #endif 963#endif
983 964
984 #ifndef CONST 965#ifndef CONST
985 #define CONST const // variables mapped to ROM (i.e. flash) 966#define CONST const // variables mapped to ROM (i.e. flash)
986 #endif 967#endif
987 968
988 #define LARGE 969#define LARGE
989 970
990 #define REENTRANT 971#define REENTRANT
991 #define PUBLIC __stdcall 972#define PUBLIC __stdcall
992 973
993 #ifndef NDEBUG 974#ifndef NDEBUG
994 #ifndef TRACE 975#ifndef TRACE
995 #include <stdio.h> 976#include <stdio.h>
996 #define TRACE printf 977#define TRACE printf
997 #endif 978#endif
998 #endif 979#endif
999 980
1000 #elif (TARGET_SYSTEM == _DOS_) 981#elif (TARGET_SYSTEM == _DOS_)
1001 982
1002 #define ROM // code or variables mapped to ROM (i.e. flash) 983#define ROM // code or variables mapped to ROM (i.e. flash)
1003 // usage: CONST BYTE ROM foo = 0x00; 984 // usage: CONST BYTE ROM foo = 0x00;
1004 #define HWACC // hardware access through external memory (i.e. CAN) 985#define HWACC // hardware access through external memory (i.e. CAN)
1005 986
1006 // These types can be adjusted by users to match application requirements. The goal is to 987 // These types can be adjusted by users to match application requirements. The goal is to
1007 // minimize code memory and maximize speed. 988 // minimize code memory and maximize speed.
1008 #define GENERIC // generic pointer to point to application data 989#define GENERIC // generic pointer to point to application data
1009 // Variables with this attribute can be located in external 990 // Variables with this attribute can be located in external
1010 // or internal data memory. 991 // or internal data memory.
1011 #define MEM // Memory attribute to optimize speed and code of pointer access. 992#define MEM // Memory attribute to optimize speed and code of pointer access.
1012 #define NEAR near // variables mapped to internal data storage location 993#define NEAR near // variables mapped to internal data storage location
1013 #define FAR far // variables mapped to external data storage location 994#define FAR far // variables mapped to external data storage location
1014 #define CONST const // variables mapped to ROM (i.e. flash) 995#define CONST const // variables mapped to ROM (i.e. flash)
1015 #define LARGE 996#define LARGE
1016 997
1017 #define REENTRANT 998#define REENTRANT
1018 #define PUBLIC 999#define PUBLIC
1019 1000
1020 #ifndef NDEBUG 1001#ifndef NDEBUG
1021 #ifndef TRACE 1002#ifndef TRACE
1022 #include <stdio.h> 1003#include <stdio.h>
1023 #define TRACE printf 1004#define TRACE printf
1024 #endif 1005#endif
1025 #endif 1006#endif
1026 1007
1027 #endif 1008#endif
1028 1009
1029#elif (_MSC_VER == 800) // PC MS Visual C/C++ for DOS applications 1010#elif (_MSC_VER == 800) // PC MS Visual C/C++ for DOS applications
1030 1011
1031 #define TARGET_SYSTEM _DOS_ 1012#define TARGET_SYSTEM _DOS_
1032 #define DEV_SYSTEM _DEV_MSVC_DOS_ 1013#define DEV_SYSTEM _DEV_MSVC_DOS_
1033 1014
1034 #define ROM // code or variables mapped to ROM (i.e. flash) 1015#define ROM // code or variables mapped to ROM (i.e. flash)
1035 // usage: CONST BYTE ROM foo = 0x00; 1016 // usage: CONST BYTE ROM foo = 0x00;
1036 #define HWACC near // hardware access through external memory (i.e. CAN) 1017#define HWACC near // hardware access through external memory (i.e. CAN)
1037 1018
1038 // These types can be adjusted by users to match application requirements. The goal is to 1019 // These types can be adjusted by users to match application requirements. The goal is to
1039 // minimize code memory and maximize speed. 1020 // minimize code memory and maximize speed.
1040 #define GENERIC // generic pointer to point to application data 1021#define GENERIC // generic pointer to point to application data
1041 // Variables with this attribute can be located in external 1022 // Variables with this attribute can be located in external
1042 // or internal data memory. 1023 // or internal data memory.
1043 #define MEM // Memory attribute to optimize speed and code of pointer access. 1024#define MEM // Memory attribute to optimize speed and code of pointer access.
1044 #define NEAR near // variables mapped to internal data storage location 1025#define NEAR near // variables mapped to internal data storage location
1045 #define FAR far // variables mapped to external data storage location 1026#define FAR far // variables mapped to external data storage location
1046 #define CONST const // variables mapped to ROM (i.e. flash) 1027#define CONST const // variables mapped to ROM (i.e. flash)
1047 #define LARGE 1028#define LARGE
1048 1029
1049 #define REENTRANT 1030#define REENTRANT
1050 #define PUBLIC 1031#define PUBLIC
1051
1052 #ifndef NDEBUG
1053 #ifndef TRACE
1054 #include <stdio.h>
1055 #define TRACE printf
1056 #endif
1057 #endif
1058 1032
1033#ifndef NDEBUG
1034#ifndef TRACE
1035#include <stdio.h>
1036#define TRACE printf
1037#endif
1038#endif
1059 1039
1060//--------------------------------------------------------------------------- 1040//---------------------------------------------------------------------------
1061// definitions for RTX under WIN32 1041// definitions for RTX under WIN32
@@ -1063,42 +1043,42 @@
1063#elif (defined (UNDER_RTSS) && defined (WIN32)) 1043#elif (defined (UNDER_RTSS) && defined (WIN32))
1064 1044
1065 // ------------------ definition target system -------------------------- 1045 // ------------------ definition target system --------------------------
1066 #define TARGET_SYSTEM _WIN32_RTX_ 1046#define TARGET_SYSTEM _WIN32_RTX_
1067 #define DEV_SYSTEM _DEV_WIN32_RTX_ 1047#define DEV_SYSTEM _DEV_WIN32_RTX_
1068 1048
1069 #define ROM // code or variables mapped to ROM (i.e. flash) 1049#define ROM // code or variables mapped to ROM (i.e. flash)
1070 // usage: CONST BYTE ROM foo = 0x00; 1050 // usage: CONST BYTE ROM foo = 0x00;
1071 #define HWACC // hardware access through external memory (i.e. CAN) 1051#define HWACC // hardware access through external memory (i.e. CAN)
1072 1052
1073 // These types can be adjusted by users to match application requirements. The goal is to 1053 // These types can be adjusted by users to match application requirements. The goal is to
1074 // minimize code memory and maximize speed. 1054 // minimize code memory and maximize speed.
1075 #define GENERIC // generic pointer to point to application data 1055#define GENERIC // generic pointer to point to application data
1076 // Variables with this attribute can be located in external 1056 // Variables with this attribute can be located in external
1077 // or internal data memory. 1057 // or internal data memory.
1078 #define MEM // Memory attribute to optimize speed and code of pointer access. 1058#define MEM // Memory attribute to optimize speed and code of pointer access.
1079 1059
1080 #ifndef NEAR 1060#ifndef NEAR
1081 #define NEAR // variables mapped to internal data storage location 1061#define NEAR // variables mapped to internal data storage location
1082 #endif 1062#endif
1083 1063
1084 #ifndef FAR 1064#ifndef FAR
1085 #define FAR // variables mapped to external data storage location 1065#define FAR // variables mapped to external data storage location
1086 #endif 1066#endif
1087 1067
1088 #ifndef CONST 1068#ifndef CONST
1089 #define CONST const // variables mapped to ROM (i.e. flash) 1069#define CONST const // variables mapped to ROM (i.e. flash)
1090 #endif 1070#endif
1091 1071
1092 #define LARGE 1072#define LARGE
1093 1073
1094 #define REENTRANT 1074#define REENTRANT
1095 #define PUBLIC __stdcall 1075#define PUBLIC __stdcall
1096 1076
1097 #ifndef NDEBUG 1077#ifndef NDEBUG
1098 #ifndef TRACE 1078#ifndef TRACE
1099 #define TRACE RtPrintf 1079#define TRACE RtPrintf
1100 #endif 1080#endif
1101 #endif 1081#endif
1102 1082
1103//--------------------------------------------------------------------------- 1083//---------------------------------------------------------------------------
1104// definitions for WinCE 1084// definitions for WinCE
@@ -1106,341 +1086,288 @@
1106#elif defined (_WIN32_WCE) 1086#elif defined (_WIN32_WCE)
1107 1087
1108 // ------------------ definition target system -------------------------- 1088 // ------------------ definition target system --------------------------
1109 #define TARGET_SYSTEM _WINCE_ 1089#define TARGET_SYSTEM _WINCE_
1110 #define DEV_SYSTEM _DEV_WIN_CE_ 1090#define DEV_SYSTEM _DEV_WIN_CE_
1111 1091
1112 #define ROM // code or variables mapped to ROM (i.e. flash) 1092#define ROM // code or variables mapped to ROM (i.e. flash)
1113 // usage: CONST BYTE ROM foo = 0x00; 1093 // usage: CONST BYTE ROM foo = 0x00;
1114 #define HWACC // hardware access through external memory (i.e. CAN) 1094#define HWACC // hardware access through external memory (i.e. CAN)
1115 1095
1116 // These types can be adjusted by users to match application requirements. The goal is to 1096 // These types can be adjusted by users to match application requirements. The goal is to
1117 // minimize code memory and maximize speed. 1097 // minimize code memory and maximize speed.
1118 #define GENERIC // generic pointer to point to application data 1098#define GENERIC // generic pointer to point to application data
1119 // Variables with this attribute can be located in external 1099 // Variables with this attribute can be located in external
1120 // or internal data memory. 1100 // or internal data memory.
1121 #define MEM // Memory attribute to optimize speed and code of pointer access. 1101#define MEM // Memory attribute to optimize speed and code of pointer access.
1122 1102
1123 #ifndef NEAR 1103#ifndef NEAR
1124 #define NEAR // variables mapped to internal data storage location 1104#define NEAR // variables mapped to internal data storage location
1125 #endif 1105#endif
1126 1106
1127 #ifndef FAR 1107#ifndef FAR
1128 #define FAR // variables mapped to external data storage location 1108#define FAR // variables mapped to external data storage location
1129 #endif 1109#endif
1130 1110
1131 #ifndef CONST 1111#ifndef CONST
1132 #define CONST const // variables mapped to ROM (i.e. flash) 1112#define CONST const // variables mapped to ROM (i.e. flash)
1133 #endif 1113#endif
1134 1114
1135 #define LARGE 1115#define LARGE
1136 1116
1137 #ifndef QWORD 1117#ifndef QWORD
1138 //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU) 1118 //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU)
1139 #define QWORD __int64 1119#define QWORD __int64
1140 #endif 1120#endif
1141 1121
1142 #define REENTRANT 1122#define REENTRANT
1143 #define PUBLIC __cdecl 1123#define PUBLIC __cdecl
1144 1124
1145 #ifdef ASSERTMSG 1125#ifdef ASSERTMSG
1146 #undef ASSERTMSG 1126#undef ASSERTMSG
1147 #endif 1127#endif
1148 1128
1149 #ifndef NDEBUG 1129#ifndef NDEBUG
1150 #ifndef TRACE 1130#ifndef TRACE
1151 #define TRACE printf 1131#define TRACE printf
1152// void trace (char *fmt, ...); 1132// void trace (char *fmt, ...);
1153 #endif 1133#endif
1154 #endif 1134#endif
1155 1135
1156#else // ===> PC MS Visual C/C++ 1136#else // ===> PC MS Visual C/C++
1157 1137
1158 // ------------------ definition target system -------------------------- 1138 // ------------------ definition target system --------------------------
1159 1139
1160 #ifdef _WIN32 1140#ifdef _WIN32
1161 #define TARGET_SYSTEM _WIN32_ // WIN32 definition 1141#define TARGET_SYSTEM _WIN32_ // WIN32 definition
1162 #define DEV_SYSTEM _DEV_WIN32_ 1142#define DEV_SYSTEM _DEV_WIN32_
1163 #else 1143#else
1164 #define TARGET_SYSTEM _WIN16_ // WIN16 definition 1144#define TARGET_SYSTEM _WIN16_ // WIN16 definition
1165 #define DEV_SYSTEM _DEV_WIN16_ 1145#define DEV_SYSTEM _DEV_WIN16_
1166 #endif 1146#endif
1167
1168 1147
1169 // ------------------ WIN16 --------------------------------------------- 1148 // ------------------ WIN16 ---------------------------------------------
1170 1149
1171 #if (TARGET_SYSTEM == _WIN16_) 1150#if (TARGET_SYSTEM == _WIN16_)
1172
1173 #define ROM // code or variables mapped to ROM (i.e. flash)
1174 // usage: CONST BYTE ROM foo = 0x00;
1175 #define HWACC // hardware access through external memory (i.e. CAN)
1176
1177 // These types can be adjusted by users to match application requirements. The goal is to
1178 // minimize code memory and maximize speed.
1179 #define GENERIC // generic pointer to point to application data
1180 // Variables with this attribute can be located in external
1181 // or internal data memory.
1182 #define MEM // Memory attribute to optimize speed and code of pointer access.
1183
1184 #ifndef NEAR
1185 #define NEAR // variables mapped to internal data storage location
1186 #endif
1187 1151
1188 #ifndef FAR 1152#define ROM // code or variables mapped to ROM (i.e. flash)
1189 #define FAR far // variables mapped to external data storage location 1153 // usage: CONST BYTE ROM foo = 0x00;
1190 #endif 1154#define HWACC // hardware access through external memory (i.e. CAN)
1191 1155
1192 #ifndef CONST 1156 // These types can be adjusted by users to match application requirements. The goal is to
1193 #define CONST const // variables mapped to ROM (i.e. flash) 1157 // minimize code memory and maximize speed.
1194 #endif 1158#define GENERIC // generic pointer to point to application data
1159 // Variables with this attribute can be located in external
1160 // or internal data memory.
1161#define MEM // Memory attribute to optimize speed and code of pointer access.
1195 1162
1196 #define LARGE 1163#ifndef NEAR
1164#define NEAR // variables mapped to internal data storage location
1165#endif
1197 1166
1198 #define REENTRANT 1167#ifndef FAR
1199 #define PUBLIC _far _pascal _export 1168#define FAR far // variables mapped to external data storage location
1169#endif
1200 1170
1201 #ifndef NDEBUG 1171#ifndef CONST
1202 #ifndef TRACE 1172#define CONST const // variables mapped to ROM (i.e. flash)
1203 #define TRACE trace 1173#endif
1204 #ifdef __cplusplus
1205 extern "C"
1206 {
1207 #endif
1208 void trace (const char *fmt, ...);
1209 #ifdef __cplusplus
1210 }
1211 #endif
1212 #endif
1213 #endif
1214 1174
1215 #endif 1175#define LARGE
1216 1176
1177#define REENTRANT
1178#define PUBLIC _far _pascal _export
1217 1179
1180#ifndef NDEBUG
1181#ifndef TRACE
1182#define TRACE trace
1183#ifdef __cplusplus
1184extern "C" {
1185#endif
1186 void trace(const char *fmt, ...);
1187#ifdef __cplusplus
1188}
1189#endif
1190#endif
1191#endif
1192#endif
1218 // ------------------ WIN32 --------------------------------------------- 1193 // ------------------ WIN32 ---------------------------------------------
1219 1194#if (TARGET_SYSTEM == _WIN32_)
1220 #if (TARGET_SYSTEM == _WIN32_) 1195#define ROM // code or variables mapped to ROM (i.e. flash)
1221 1196 // usage: CONST BYTE ROM foo = 0x00;
1222 #define ROM // code or variables mapped to ROM (i.e. flash) 1197#define HWACC // hardware access through external memory (i.e. CAN)
1223 // usage: CONST BYTE ROM foo = 0x00; 1198 // These types can be adjusted by users to match application requirements. The goal is to// minimize code memory and maximize speed.
1224 #define HWACC // hardware access through external memory (i.e. CAN) 1199#define GENERIC // generic pointer to point to application data
1225 1200 // Variables with this attribute can be located in external// or internal data memory.
1226 // These types can be adjusted by users to match application requirements. The goal is to 1201#define MEM // Memory attribute to optimize speed and code of pointer access.
1227 // minimize code memory and maximize speed. 1202#ifndef NEAR
1228 #define GENERIC // generic pointer to point to application data 1203#define NEAR // variables mapped to internal data storage location
1229 // Variables with this attribute can be located in external 1204#endif
1230 // or internal data memory. 1205#ifndef FAR
1231 #define MEM // Memory attribute to optimize speed and code of pointer access. 1206#define FAR // variables mapped to external data storage location
1232 1207#endif
1233 #ifndef NEAR 1208#ifndef CONST
1234 #define NEAR // variables mapped to internal data storage location 1209#define CONST const // variables mapped to ROM (i.e. flash)
1235 #endif 1210#endif
1236 1211#define LARGE
1237 #ifndef FAR 1212#define REENTRANT
1238 #define FAR // variables mapped to external data storage location 1213#define PUBLIC __stdcall
1239 #endif 1214#ifndef QWORD
1240 1215 //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU)
1241 #ifndef CONST 1216#define QWORD __int64
1242 #define CONST const // variables mapped to ROM (i.e. flash) 1217#endif
1243 #endif 1218#ifndef NDEBUG
1244 1219#ifndef TRACE
1245 #define LARGE 1220#define TRACE trace
1246 1221#ifdef __cplusplus
1247 #define REENTRANT 1222extern "C" {
1248 #define PUBLIC __stdcall 1223#endif
1249 1224 void trace(const char *fmt, ...);
1250 #ifndef QWORD 1225#ifdef __cplusplus
1251 //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU) 1226}
1252 #define QWORD __int64 1227#endif
1253 #endif 1228#endif
1254 1229#endif
1255 #ifndef NDEBUG 1230 // MS Visual C++ compiler supports function inlining
1256 #ifndef TRACE 1231#define INLINE_FUNCTION_DEF __forceinline
1257 #define TRACE trace 1232 // to actually enable inlining just include the following two lines// #define INLINE_FUNCTION INLINE_FUNCTION_DEF// #define INLINE_ENABLED TRUE
1258 #ifdef __cplusplus 1233#endif
1259 extern "C" 1234#endif // ===> PC
1260 { 1235//---------------------------------------------------------------------------// definitions of basic types//---------------------------------------------------------------------------
1261 #endif 1236#ifndef _WINDEF_ // defined in WINDEF.H, included by <windows.h>
1262 void trace (const char *fmt, ...);
1263 #ifdef __cplusplus
1264 }
1265 #endif
1266 #endif
1267 #endif
1268
1269 // MS Visual C++ compiler supports function inlining
1270 #define INLINE_FUNCTION_DEF __forceinline
1271
1272 // to actually enable inlining just include the following two lines
1273 // #define INLINE_FUNCTION INLINE_FUNCTION_DEF
1274 // #define INLINE_ENABLED TRUE
1275
1276 #endif
1277
1278#endif // ===> PC
1279
1280
1281//---------------------------------------------------------------------------
1282// definitions of basic types
1283//---------------------------------------------------------------------------
1284
1285#ifndef _WINDEF_ // defined in WINDEF.H, included by <windows.h>
1286
1287 // --- arithmetic types --- 1237 // --- arithmetic types ---
1288 #ifndef SHORT 1238#ifndef SHORT
1289 #define SHORT short int 1239#define SHORT short int
1290 #endif 1240#endif
1291 1241#ifndef USHORT
1292 #ifndef USHORT 1242#define USHORT unsigned short int
1293 #define USHORT unsigned short int 1243#endif
1294 #endif 1244#ifndef INT
1295 1245#define INT int
1296 #ifndef INT 1246#endif
1297 #define INT int 1247#ifndef UINT
1298 #endif 1248#define UINT unsigned int
1299 1249#endif
1300 #ifndef UINT 1250#ifndef LONG
1301 #define UINT unsigned int 1251#define LONG long int
1302 #endif 1252#endif
1303 1253#ifndef ULONG
1304 #ifndef LONG 1254#define ULONG unsigned long int
1305 #define LONG long int 1255#endif
1306 #endif
1307
1308 #ifndef ULONG
1309 #define ULONG unsigned long int
1310 #endif
1311
1312
1313 // --- logic types --- 1256 // --- logic types ---
1314 #ifndef BYTE 1257#ifndef BYTE
1315 #define BYTE unsigned char 1258#define BYTE unsigned char
1316 #endif 1259#endif
1317 1260#ifndef WORD
1318 #ifndef WORD 1261#define WORD unsigned short int
1319 #define WORD unsigned short int 1262#endif
1320 #endif 1263#ifndef DWORD
1321 1264#define DWORD unsigned long int
1322 #ifndef DWORD 1265#endif
1323 #define DWORD unsigned long int 1266#ifndef BOOL
1324 #endif 1267#define BOOL unsigned char
1325 1268#endif
1326 #ifndef BOOL
1327 #define BOOL unsigned char
1328 #endif
1329
1330
1331 // --- alias types --- 1269 // --- alias types ---
1332 #ifndef TRUE 1270#ifndef TRUE
1333 #define TRUE 0xFF 1271#define TRUE 0xFF
1334 #endif 1272#endif
1335 1273#ifndef FALSE
1336 #ifndef FALSE 1274#define FALSE 0x00
1337 #define FALSE 0x00 1275#endif
1338 #endif 1276#ifndef NULL
1339 1277#define NULL ((void *) 0)
1340 #ifndef NULL 1278#endif
1341 #define NULL ((void *) 0)
1342 #endif
1343
1344#endif 1279#endif
1345
1346
1347#ifndef _TIME_OF_DAY_DEFINED_ 1280#ifndef _TIME_OF_DAY_DEFINED_
1281typedef struct {
1282 unsigned long int m_dwMs;
1283 unsigned short int m_wDays;
1348 1284
1349 typedef struct 1285} tTimeOfDay;
1350 {
1351 unsigned long int m_dwMs;
1352 unsigned short int m_wDays;
1353 1286
1354 } tTimeOfDay; 1287#define _TIME_OF_DAY_DEFINED_
1355
1356 #define _TIME_OF_DAY_DEFINED_
1357 1288
1358#endif 1289#endif
1359 1290
1360
1361//--------------------------------------------------------------------------- 1291//---------------------------------------------------------------------------
1362// Definition von TRACE 1292// Definition von TRACE
1363//--------------------------------------------------------------------------- 1293//---------------------------------------------------------------------------
1364 1294
1365#ifndef NDEBUG 1295#ifndef NDEBUG
1366 1296
1367 #ifndef TRACE0 1297#ifndef TRACE0
1368 #define TRACE0(p0) TRACE(p0) 1298#define TRACE0(p0) TRACE(p0)
1369 #endif 1299#endif
1370 1300
1371 #ifndef TRACE1 1301#ifndef TRACE1
1372 #define TRACE1(p0, p1) TRACE(p0, p1) 1302#define TRACE1(p0, p1) TRACE(p0, p1)
1373 #endif 1303#endif
1374 1304
1375 #ifndef TRACE2 1305#ifndef TRACE2
1376 #define TRACE2(p0, p1, p2) TRACE(p0, p1, p2) 1306#define TRACE2(p0, p1, p2) TRACE(p0, p1, p2)
1377 #endif 1307#endif
1378 1308
1379 #ifndef TRACE3 1309#ifndef TRACE3
1380 #define TRACE3(p0, p1, p2, p3) TRACE(p0, p1, p2, p3) 1310#define TRACE3(p0, p1, p2, p3) TRACE(p0, p1, p2, p3)
1381 #endif 1311#endif
1382 1312
1383 #ifndef TRACE4 1313#ifndef TRACE4
1384 #define TRACE4(p0, p1, p2, p3, p4) TRACE(p0, p1, p2, p3, p4) 1314#define TRACE4(p0, p1, p2, p3, p4) TRACE(p0, p1, p2, p3, p4)
1385 #endif 1315#endif
1386 1316
1387 #ifndef TRACE5 1317#ifndef TRACE5
1388 #define TRACE5(p0, p1, p2, p3, p4, p5) TRACE(p0, p1, p2, p3, p4, p5) 1318#define TRACE5(p0, p1, p2, p3, p4, p5) TRACE(p0, p1, p2, p3, p4, p5)
1389 #endif 1319#endif
1390 1320
1391 #ifndef TRACE6 1321#ifndef TRACE6
1392 #define TRACE6(p0, p1, p2, p3, p4, p5, p6) TRACE(p0, p1, p2, p3, p4, p5, p6) 1322#define TRACE6(p0, p1, p2, p3, p4, p5, p6) TRACE(p0, p1, p2, p3, p4, p5, p6)
1393 #endif 1323#endif
1394 1324
1395#else 1325#else
1396 1326
1397 #ifndef TRACE0 1327#ifndef TRACE0
1398 #define TRACE0(p0) 1328#define TRACE0(p0)
1399 #endif 1329#endif
1400
1401 #ifndef TRACE1
1402 #define TRACE1(p0, p1)
1403 #endif
1404
1405 #ifndef TRACE2
1406 #define TRACE2(p0, p1, p2)
1407 #endif
1408 1330
1409 #ifndef TRACE3 1331#ifndef TRACE1
1410 #define TRACE3(p0, p1, p2, p3) 1332#define TRACE1(p0, p1)
1411 #endif 1333#endif
1412 1334
1413 #ifndef TRACE4 1335#ifndef TRACE2
1414 #define TRACE4(p0, p1, p2, p3, p4) 1336#define TRACE2(p0, p1, p2)
1415 #endif 1337#endif
1416 1338
1417 #ifndef TRACE5 1339#ifndef TRACE3
1418 #define TRACE5(p0, p1, p2, p3, p4, p5) 1340#define TRACE3(p0, p1, p2, p3)
1419 #endif 1341#endif
1420 1342
1421 #ifndef TRACE6 1343#ifndef TRACE4
1422 #define TRACE6(p0, p1, p2, p3, p4, p5, p6) 1344#define TRACE4(p0, p1, p2, p3, p4)
1423 #endif 1345#endif
1424 1346
1347#ifndef TRACE5
1348#define TRACE5(p0, p1, p2, p3, p4, p5)
1425#endif 1349#endif
1426 1350
1351#ifndef TRACE6
1352#define TRACE6(p0, p1, p2, p3, p4, p5, p6)
1353#endif
1427 1354
1355#endif
1428 1356
1429//--------------------------------------------------------------------------- 1357//---------------------------------------------------------------------------
1430// definition of ASSERT 1358// definition of ASSERT
1431//--------------------------------------------------------------------------- 1359//---------------------------------------------------------------------------
1432 1360
1433#ifndef ASSERT 1361#ifndef ASSERT
1434 #if !defined (__linux__) && !defined (__KERNEL__) 1362#if !defined (__linux__) && !defined (__KERNEL__)
1435 #include <assert.h> 1363#include <assert.h>
1436 #ifndef ASSERT 1364#ifndef ASSERT
1437 #define ASSERT(p) assert(p) 1365#define ASSERT(p) assert(p)
1438 #endif 1366#endif
1439 #else 1367#else
1440 #define ASSERT(p) 1368#define ASSERT(p)
1441 #endif 1369#endif
1442#endif 1370#endif
1443
1444 1371
1445//--------------------------------------------------------------------------- 1372//---------------------------------------------------------------------------
1446// SYS TEC extensions 1373// SYS TEC extensions
@@ -1450,19 +1377,15 @@
1450// but a string, which exactly names the mistake. 1377// but a string, which exactly names the mistake.
1451#ifndef NDEBUG 1378#ifndef NDEBUG
1452 1379
1453 #define ASSERTMSG(expr,string) if (!(expr)) {\ 1380#define ASSERTMSG(expr,string) if (!(expr)) {\
1454 PRINTF0 ("Assertion failed: " string );\ 1381 PRINTF0 ("Assertion failed: " string );\
1455 while (1);} 1382 while (1);}
1456#else 1383#else
1457 #define ASSERTMSG(expr,string) 1384#define ASSERTMSG(expr,string)
1458#endif 1385#endif
1459 1386
1460
1461
1462
1463//--------------------------------------------------------------------------- 1387//---------------------------------------------------------------------------
1464 1388
1465#endif // #ifndef _GLOBAL_H_ 1389#endif // #ifndef _GLOBAL_H_
1466 1390
1467// Please keep an empty line at the end of this file. 1391// Please keep an empty line at the end of this file.
1468