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