Home Alert System

Dependencies:   PWM_Tone_Library DHT

Committer:
aziz111
Date:
Fri Mar 08 17:15:02 2019 +0000
Revision:
5:569a4894abc1
Parent:
3:78f223d34f36
Final

Who changed what in which revision?

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