Opencv 3.1 project on GR-PEACH board

Fork of gr-peach-opencv-project by the do

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?

UserRevisionLine numberNew 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_ASSERT_H
thedo 167:1657b442184c 20 #define MBED_ASSERT_H
thedo 167:1657b442184c 21
thedo 167:1657b442184c 22 #include "mbed_preprocessor.h"
thedo 167:1657b442184c 23
thedo 167:1657b442184c 24 #ifdef __cplusplus
thedo 167:1657b442184c 25 extern "C" {
thedo 167:1657b442184c 26 #endif
thedo 167:1657b442184c 27
thedo 167:1657b442184c 28 /** Internal mbed assert function which is invoked when MBED_ASSERT macro failes.
thedo 167:1657b442184c 29 * This function is active only if NDEBUG is not defined prior to including this
thedo 167:1657b442184c 30 * assert header file.
thedo 167:1657b442184c 31 * In case of MBED_ASSERT failing condition, error() is called with the assertation message.
thedo 167:1657b442184c 32 * @param expr Expresion to be checked.
thedo 167:1657b442184c 33 * @param file File where assertation failed.
thedo 167:1657b442184c 34 * @param line Failing assertation line number.
thedo 167:1657b442184c 35 */
thedo 167:1657b442184c 36 void mbed_assert_internal(const char *expr, const char *file, int line);
thedo 167:1657b442184c 37
thedo 167:1657b442184c 38 #ifdef __cplusplus
thedo 167:1657b442184c 39 }
thedo 167:1657b442184c 40 #endif
thedo 167:1657b442184c 41
thedo 167:1657b442184c 42 #ifdef NDEBUG
thedo 167:1657b442184c 43 #define MBED_ASSERT(expr) ((void)0)
thedo 167:1657b442184c 44
thedo 167:1657b442184c 45 #else
thedo 167:1657b442184c 46 #define MBED_ASSERT(expr) \
thedo 167:1657b442184c 47 do { \
thedo 167:1657b442184c 48 if (!(expr)) { \
thedo 167:1657b442184c 49 mbed_assert_internal(#expr, __FILE__, __LINE__); \
thedo 167:1657b442184c 50 } \
thedo 167:1657b442184c 51 } while (0)
thedo 167:1657b442184c 52 #endif
thedo 167:1657b442184c 53
thedo 167:1657b442184c 54
thedo 167:1657b442184c 55 /** MBED_STATIC_ASSERT
thedo 167:1657b442184c 56 * Declare compile-time assertions, results in compile-time error if condition is false
thedo 167:1657b442184c 57 *
thedo 167:1657b442184c 58 * The assertion acts as a declaration that can be placed at file scope, in a
thedo 167:1657b442184c 59 * code block (except after a label), or as a member of a C++ class/struct/union.
thedo 167:1657b442184c 60 *
thedo 167:1657b442184c 61 * @note
thedo 167:1657b442184c 62 * Use of MBED_STATIC_ASSERT as a member of a struct/union is limited:
thedo 167:1657b442184c 63 * - In C++, MBED_STATIC_ASSERT is valid in class/struct/union scope.
thedo 167:1657b442184c 64 * - In C, MBED_STATIC_ASSERT is not valid in struct/union scope, and
thedo 167:1657b442184c 65 * MBED_STRUCT_STATIC_ASSERT is provided as an alternative that is valid
thedo 167:1657b442184c 66 * in C and C++ class/struct/union scope.
thedo 167:1657b442184c 67 *
thedo 167:1657b442184c 68 * @code
thedo 167:1657b442184c 69 * MBED_STATIC_ASSERT(MBED_LIBRARY_VERSION >= 120,
thedo 167:1657b442184c 70 * "The mbed library must be at least version 120");
thedo 167:1657b442184c 71 *
thedo 167:1657b442184c 72 * int main() {
thedo 167:1657b442184c 73 * MBED_STATIC_ASSERT(sizeof(int) >= sizeof(char),
thedo 167:1657b442184c 74 * "An int must be larger than a char");
thedo 167:1657b442184c 75 * }
thedo 167:1657b442184c 76 * @endcode
thedo 167:1657b442184c 77 */
thedo 167:1657b442184c 78 #if defined(__cplusplus) && (__cplusplus >= 201103L || __cpp_static_assert >= 200410L)
thedo 167:1657b442184c 79 #define MBED_STATIC_ASSERT(expr, msg) static_assert(expr, msg)
thedo 167:1657b442184c 80 #elif !defined(__cplusplus) && __STDC_VERSION__ >= 201112L
thedo 167:1657b442184c 81 #define MBED_STATIC_ASSERT(expr, msg) _Static_assert(expr, msg)
thedo 167:1657b442184c 82 #elif defined(__cplusplus) && defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) \
thedo 167:1657b442184c 83 && (__GNUC__*100 + __GNUC_MINOR__) > 403L
thedo 167:1657b442184c 84 #define MBED_STATIC_ASSERT(expr, msg) __extension__ static_assert(expr, msg)
thedo 167:1657b442184c 85 #elif !defined(__cplusplus) && defined(__GNUC__) && !defined(__CC_ARM) \
thedo 167:1657b442184c 86 && (__GNUC__*100 + __GNUC_MINOR__) > 406L
thedo 167:1657b442184c 87 #define MBED_STATIC_ASSERT(expr, msg) __extension__ _Static_assert(expr, msg)
thedo 167:1657b442184c 88 #elif defined(__ICCARM__)
thedo 167:1657b442184c 89 #define MBED_STATIC_ASSERT(expr, msg) static_assert(expr, msg)
thedo 167:1657b442184c 90 #else
thedo 167:1657b442184c 91 #define MBED_STATIC_ASSERT(expr, msg) \
thedo 167:1657b442184c 92 enum {MBED_CONCAT(MBED_ASSERTION_AT_, __LINE__) = sizeof(char[(expr) ? 1 : -1])}
thedo 167:1657b442184c 93 #endif
thedo 167:1657b442184c 94
thedo 167:1657b442184c 95 /** MBED_STRUCT_STATIC_ASSERT
thedo 167:1657b442184c 96 * Declare compile-time assertions, results in compile-time error if condition is false
thedo 167:1657b442184c 97 *
thedo 167:1657b442184c 98 * Unlike MBED_STATIC_ASSERT, MBED_STRUCT_STATIC_ASSERT can and must be used
thedo 167:1657b442184c 99 * as a member of a C/C++ class/struct/union.
thedo 167:1657b442184c 100 *
thedo 167:1657b442184c 101 * @code
thedo 167:1657b442184c 102 * struct thing {
thedo 167:1657b442184c 103 * MBED_STATIC_ASSERT(2 + 2 == 4,
thedo 167:1657b442184c 104 * "Hopefully the universe is mathematically consistent");
thedo 167:1657b442184c 105 * };
thedo 167:1657b442184c 106 * @endcode
thedo 167:1657b442184c 107 */
thedo 167:1657b442184c 108 #define MBED_STRUCT_STATIC_ASSERT(expr, msg) int : (expr) ? 0 : -1
thedo 167:1657b442184c 109
thedo 167:1657b442184c 110
thedo 167:1657b442184c 111 #endif
thedo 167:1657b442184c 112
thedo 167:1657b442184c 113 /** @}*/
thedo 167:1657b442184c 114