Mistake on this page?
Report an issue in GitHub or email us
mbed_debug.h
1 
9 /* mbed Microcontroller Library
10  * Copyright (c) 2006-2013 ARM Limited
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24 #ifndef MBED_DEBUG_H
25 #define MBED_DEBUG_H
26 #if DEVICE_STDIO_MESSAGES
27 #include <stdio.h>
28 #include <stdarg.h>
29 #endif
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 
40 static inline void debug(const char *format, ...) {
41 #if DEVICE_STDIO_MESSAGES && !defined(NDEBUG)
42  va_list args;
43  va_start(args, format);
44  vfprintf(stderr, format, args);
45  va_end(args);
46 #endif
47 }
48 
49 
58 static inline void debug_if(int condition, const char *format, ...) {
59 #if DEVICE_STDIO_MESSAGES && !defined(NDEBUG)
60  if (condition) {
61  va_list args;
62  va_start(args, format);
63  vfprintf(stderr, format, args);
64  va_end(args);
65  }
66 #endif
67 }
68 
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif
75 
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.