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