1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
6 * This source code is free software; you can redistribute it and/or modify it
\r
7 * under the terms of the GNU General Public License version 2 as published by the
\r
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
10 * This program is distributed in the hope that it will be useful, but
\r
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * -------------------------------- Arctic Core ------------------------------*/
\r
17 // PC-Lint Exception to MISRA rule 19.12: stdio ok in debug.h.
\r
27 * Do not use this in a header file. Should be used in the *.c file like this.
\r
29 * #define USE_DEBUG_PRINTF
\r
30 * #include "debug.h"
\r
32 * Macro's for debugging and tracing
\r
34 * Define USE_LDEBUG_PRINTF and DBG_LEVEL either globally( e.g. a makefile )
\r
35 * or in a specific file. The DBG_LEVEL macro controls the amount
\r
36 * of detail you want in the debug printout.
\r
37 * There are 3 levels:
\r
38 * DEBUG_LOW - Used mainly by drivers to get very detailed
\r
39 * DEBUG_MEDIUM - Medium detail
\r
40 * DEBUG_HIGH - General init
\r
43 * #define DEBUG_LVL DEBUG_HIGH
\r
44 * DEBUG(DEBUG_HIGH,"Starting GPT");
\r
54 #define DEBUG_MEDIUM 2
\r
55 #define DEBUG_HIGH 3
\r
56 #define DEBUG_NONE 4
\r
66 #if defined(USE_DEBUG_PRINTF)
\r
67 #define DEBUG(_level,...) \
\r
69 if(_level>=DEBUG_LVL) { \
\r
70 printf (__VA_ARGS__); \
\r
75 #define DEBUG(_level,...)
\r
78 #if defined(USE_LDEBUG_PRINTF)
\r
79 #define LDEBUG_PRINTF(format,...) printf(format,## __VA_ARGS__ )
\r
80 #define LDEBUG_FPUTS(_str) fputs((_str),stdout)
\r
82 #define LDEBUG_PRINTF(format,...)
\r
83 #define LDEBUG_FPUTS(_str)
\r