]> rtime.felk.cvut.cz Git - arc.git/blob - include/Ramlog.h
msys make fix. It should should now be possible to build with a case sensitve nativat...
[arc.git] / include / Ramlog.h
1 /* -------------------------------- Arctic Core ------------------------------
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com
3  *
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
5  *
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>.
9  *
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
13  * for more details.
14  * -------------------------------- Arctic Core ------------------------------*/
15 \r
16 #ifndef RAMLOG_H_\r
17 #define RAMLOG_H_\r
18
19 #include <stdint.h>\r
20 #include "xtoa.h"\r
21
22 #if !defined(USE_RAMLOG)\r
23 #define ramlog_str( _x)
24 #define ramlog_dec( _x)
25 #define ramlog_hex( _x)
26
27 #else
28
29 void ramlog_puts( char *str );\r
30 \r
31 /*\r
32  * Fast ramlog functions
33  */\r
34 static inline void ramlog_str( char *str ) {\r
35   ramlog_puts(str);\r
36 }\r
37 \r
38 static inline void ramlog_dec( int val ) {\r
39   char str[10]; // include '-' and \0\r
40   ultoa(val,str,10);\r
41   ramlog_str(str);\r
42 }\r
43 \r
44 static inline void ramlog_hex( uint32_t val ) {\r
45   char str[10]; // include '-' and \0\r
46   ultoa(val,str,16);\r
47   ramlog_str(str);\r
48 }\r
49 #endif
50
51 \r
52 /*\r
53  * var args ramlog functions\r
54  */
55 #if defined(USE_RAMLOG_PRINTF)\r
56 int ramlog_printf(const char *format, ...);\r
57 #else
58 #define ramlog_printf(format,...)
59 #endif
60 \r
61 #endif /* RAMLOG_H_ */
62 \r