Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
103:bad568076d81
.

Who changed what in which revision?

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