1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
21 #include "simple_printf.h"
\r
25 * Do not use this in a header file. Should be used in the *.c file like this.
\r
28 * #include "Trace.h"
\r
30 * Macro's for debugging and tracing
\r
32 * Define USE_DEBUG and DBG_LEVEL either globally( e.g. a makefile )
\r
33 * or in a specific file. The DBG_LEVEL macro controls the amount
\r
34 * of detail you want in the debug printout.
\r
35 * There are 3 levels:
\r
36 * DEBUG_LOW - Used mainly by drivers to get very detailed
\r
37 * DEBUG_MEDIUM - Medium detail
\r
38 * DEBUG_HIGH - General init
\r
41 * #define DEBUG_LVL DEBUG_HIGH
\r
42 * DEBUG(DEBUG_HIGH,"Starting GPT");
\r
50 #define DEBUG_MEDIUM 2
\r
51 #define DEBUG_HIGH 3
\r
60 #if defined(USE_DEBUG)
\r
61 #define DEBUG(_level,...) \
\r
63 if(_level>=DEBUG_LVL) { \
\r
64 simple_printf (__VA_ARGS__); \
\r
69 #define DEBUG(_level,...)
\r
72 #if defined(USE_DEBUG)
\r
73 #define dbg_printf(format,...) simple_printf(format,## __VA_ARGS__ )
\r
75 #define dbg_printf(format,...)
\r
79 #endif /*RAMLOG_H_*/
\r