MRMS
vl53l0x_platform_log.h
1 /*******************************************************************************
2 Copyright © 2015, STMicroelectronics International N.V.
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of STMicroelectronics nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
19 NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED.
20 IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY
21 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 ********************************************************************************/
28 
29 
30 #ifndef _VL53L0X_PLATFORM_LOG_H_
31 #define _VL53L0X_PLATFORM_LOG_H_
32 
33 #include <stdio.h>
34 #include <string.h>
35 /* LOG Functions */
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
47 enum {
48  TRACE_LEVEL_NONE,
49  TRACE_LEVEL_ERRORS,
50  TRACE_LEVEL_WARNING,
51  TRACE_LEVEL_INFO,
52  TRACE_LEVEL_DEBUG,
53  TRACE_LEVEL_ALL,
54  TRACE_LEVEL_IGNORE
55 };
56 
57 enum {
58  TRACE_FUNCTION_NONE = 0,
59  TRACE_FUNCTION_I2C = 1,
60  TRACE_FUNCTION_ALL = 0x7fffffff //all bits except sign
61 };
62 
63 enum {
64  TRACE_MODULE_NONE = 0x0,
65  TRACE_MODULE_API = 0x1,
66  TRACE_MODULE_PLATFORM = 0x2,
67  TRACE_MODULE_ALL = 0x7fffffff //all bits except sign
68 };
69 
70 
71  #define VL53L0X_ErrLog(...) (void)0
72  #define _LOG_FUNCTION_START(module, fmt, ... ) (void)0
73  #define _LOG_FUNCTION_END(module, status, ... ) (void)0
74  #define _LOG_FUNCTION_END_FMT(module, status, fmt, ... ) (void)0
75 
76 #define VL53L0X_COPYSTRING(str, ...) strcpy(str, ##__VA_ARGS__)
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* _VL53L0X_PLATFORM_LOG_H_ */
83 
84 
85