temp

Dependencies:   mbed SDFileSystem MS5607 ADXL345_I2C FATFileSystem

Committer:
IKobayashi
Date:
Mon Mar 16 23:37:42 2020 +0900
Revision:
0:c88c3b616c00
copy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IKobayashi 0:c88c3b616c00 1
IKobayashi 0:c88c3b616c00 2 /** \addtogroup platform */
IKobayashi 0:c88c3b616c00 3 /** @{*/
IKobayashi 0:c88c3b616c00 4 /* mbed Microcontroller Library
IKobayashi 0:c88c3b616c00 5 * Copyright (c) 2006-2013 ARM Limited
IKobayashi 0:c88c3b616c00 6 *
IKobayashi 0:c88c3b616c00 7 * Licensed under the Apache License, Version 2.0 (the "License");
IKobayashi 0:c88c3b616c00 8 * you may not use this file except in compliance with the License.
IKobayashi 0:c88c3b616c00 9 * You may obtain a copy of the License at
IKobayashi 0:c88c3b616c00 10 *
IKobayashi 0:c88c3b616c00 11 * http://www.apache.org/licenses/LICENSE-2.0
IKobayashi 0:c88c3b616c00 12 *
IKobayashi 0:c88c3b616c00 13 * Unless required by applicable law or agreed to in writing, software
IKobayashi 0:c88c3b616c00 14 * distributed under the License is distributed on an "AS IS" BASIS,
IKobayashi 0:c88c3b616c00 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
IKobayashi 0:c88c3b616c00 16 * See the License for the specific language governing permissions and
IKobayashi 0:c88c3b616c00 17 * limitations under the License.
IKobayashi 0:c88c3b616c00 18 */
IKobayashi 0:c88c3b616c00 19 #ifndef MBED_DEBUG_H
IKobayashi 0:c88c3b616c00 20 #define MBED_DEBUG_H
IKobayashi 0:c88c3b616c00 21 #include "device.h"
IKobayashi 0:c88c3b616c00 22
IKobayashi 0:c88c3b616c00 23 #ifdef __cplusplus
IKobayashi 0:c88c3b616c00 24 extern "C" {
IKobayashi 0:c88c3b616c00 25 #endif
IKobayashi 0:c88c3b616c00 26
IKobayashi 0:c88c3b616c00 27 #if DEVICE_STDIO_MESSAGES
IKobayashi 0:c88c3b616c00 28 #include <stdio.h>
IKobayashi 0:c88c3b616c00 29 #include <stdarg.h>
IKobayashi 0:c88c3b616c00 30
IKobayashi 0:c88c3b616c00 31 /** Output a debug message
IKobayashi 0:c88c3b616c00 32 *
IKobayashi 0:c88c3b616c00 33 * @param format printf-style format string, followed by variables
IKobayashi 0:c88c3b616c00 34 */
IKobayashi 0:c88c3b616c00 35 static inline void debug(const char *format, ...) {
IKobayashi 0:c88c3b616c00 36 va_list args;
IKobayashi 0:c88c3b616c00 37 va_start(args, format);
IKobayashi 0:c88c3b616c00 38 vfprintf(stderr, format, args);
IKobayashi 0:c88c3b616c00 39 va_end(args);
IKobayashi 0:c88c3b616c00 40 }
IKobayashi 0:c88c3b616c00 41
IKobayashi 0:c88c3b616c00 42 /** Conditionally output a debug message
IKobayashi 0:c88c3b616c00 43 *
IKobayashi 0:c88c3b616c00 44 * NOTE: If the condition is constant false (!= 1) and the compiler optimization
IKobayashi 0:c88c3b616c00 45 * level is greater than 0, then the whole function will be compiled away.
IKobayashi 0:c88c3b616c00 46 *
IKobayashi 0:c88c3b616c00 47 * @param condition output only if condition is true (== 1)
IKobayashi 0:c88c3b616c00 48 * @param format printf-style format string, followed by variables
IKobayashi 0:c88c3b616c00 49 */
IKobayashi 0:c88c3b616c00 50 static inline void debug_if(int condition, const char *format, ...) {
IKobayashi 0:c88c3b616c00 51 if (condition == 1) {
IKobayashi 0:c88c3b616c00 52 va_list args;
IKobayashi 0:c88c3b616c00 53 va_start(args, format);
IKobayashi 0:c88c3b616c00 54 vfprintf(stderr, format, args);
IKobayashi 0:c88c3b616c00 55 va_end(args);
IKobayashi 0:c88c3b616c00 56 }
IKobayashi 0:c88c3b616c00 57 }
IKobayashi 0:c88c3b616c00 58
IKobayashi 0:c88c3b616c00 59 #else
IKobayashi 0:c88c3b616c00 60 static inline void debug(const char *format, ...) {}
IKobayashi 0:c88c3b616c00 61 static inline void debug_if(int condition, const char *format, ...) {}
IKobayashi 0:c88c3b616c00 62
IKobayashi 0:c88c3b616c00 63 #endif
IKobayashi 0:c88c3b616c00 64
IKobayashi 0:c88c3b616c00 65 #ifdef __cplusplus
IKobayashi 0:c88c3b616c00 66 }
IKobayashi 0:c88c3b616c00 67 #endif
IKobayashi 0:c88c3b616c00 68
IKobayashi 0:c88c3b616c00 69 #endif
IKobayashi 0:c88c3b616c00 70
IKobayashi 0:c88c3b616c00 71 /** @}*/