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