The code from https://github.com/vpcola/Nucleo

Committer:
sinrab
Date:
Wed Oct 08 11:00:24 2014 +0000
Revision:
0:5464d5e415e5
The code from https://github.com/vpcola/Nucleo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sinrab 0:5464d5e415e5 1 /* mbed Microcontroller Library
sinrab 0:5464d5e415e5 2 * Copyright (c) 2006-2013 ARM Limited
sinrab 0:5464d5e415e5 3 *
sinrab 0:5464d5e415e5 4 * Licensed under the Apache License, Version 2.0 (the "License");
sinrab 0:5464d5e415e5 5 * you may not use this file except in compliance with the License.
sinrab 0:5464d5e415e5 6 * You may obtain a copy of the License at
sinrab 0:5464d5e415e5 7 *
sinrab 0:5464d5e415e5 8 * http://www.apache.org/licenses/LICENSE-2.0
sinrab 0:5464d5e415e5 9 *
sinrab 0:5464d5e415e5 10 * Unless required by applicable law or agreed to in writing, software
sinrab 0:5464d5e415e5 11 * distributed under the License is distributed on an "AS IS" BASIS,
sinrab 0:5464d5e415e5 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
sinrab 0:5464d5e415e5 13 * See the License for the specific language governing permissions and
sinrab 0:5464d5e415e5 14 * limitations under the License.
sinrab 0:5464d5e415e5 15 */
sinrab 0:5464d5e415e5 16 #ifndef MBED_ASSERT_H
sinrab 0:5464d5e415e5 17 #define MBED_ASSERT_H
sinrab 0:5464d5e415e5 18
sinrab 0:5464d5e415e5 19 #ifdef __cplusplus
sinrab 0:5464d5e415e5 20 extern "C" {
sinrab 0:5464d5e415e5 21 #endif
sinrab 0:5464d5e415e5 22
sinrab 0:5464d5e415e5 23 /** Internal mbed assert function which is invoked when MBED_ASSERT macro failes.
sinrab 0:5464d5e415e5 24 * This function is active only if NDEBUG is not defined prior to including this
sinrab 0:5464d5e415e5 25 * assert header file.
sinrab 0:5464d5e415e5 26 * In case of MBED_ASSERT failing condition, the assertation message is printed
sinrab 0:5464d5e415e5 27 * to stderr and mbed_die() is called.
sinrab 0:5464d5e415e5 28 * @param expr Expresion to be checked.
sinrab 0:5464d5e415e5 29 * @param file File where assertation failed.
sinrab 0:5464d5e415e5 30 * @param line Failing assertation line number.
sinrab 0:5464d5e415e5 31 */
sinrab 0:5464d5e415e5 32 void mbed_assert_internal(const char *expr, const char *file, int line);
sinrab 0:5464d5e415e5 33
sinrab 0:5464d5e415e5 34 #ifdef __cplusplus
sinrab 0:5464d5e415e5 35 }
sinrab 0:5464d5e415e5 36 #endif
sinrab 0:5464d5e415e5 37
sinrab 0:5464d5e415e5 38 #ifdef NDEBUG
sinrab 0:5464d5e415e5 39 #define MBED_ASSERT(expr) ((void)0)
sinrab 0:5464d5e415e5 40
sinrab 0:5464d5e415e5 41 #else
sinrab 0:5464d5e415e5 42 #define MBED_ASSERT(expr) \
sinrab 0:5464d5e415e5 43 do { \
sinrab 0:5464d5e415e5 44 if (!(expr)) { \
sinrab 0:5464d5e415e5 45 mbed_assert_internal(#expr, __FILE__, __LINE__); \
sinrab 0:5464d5e415e5 46 } \
sinrab 0:5464d5e415e5 47 } while (0)
sinrab 0:5464d5e415e5 48 #endif
sinrab 0:5464d5e415e5 49
sinrab 0:5464d5e415e5 50 #endif
sinrab 0:5464d5e415e5 51