Xbee s2b for lpc11u24

Dependencies:   DigiLogger

Dependents:  

Fork of XBeeLib by Digi International Inc.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Debug.h Source File

Debug.h

00001 /**
00002  * Copyright (c) 2015 Digi International Inc.,
00003  * All rights not expressly granted are reserved.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
00007  * You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
00010  * =======================================================================
00011  */
00012 
00013 #if !defined(__DEBUG_H_)
00014 #define __DEBUG_H_
00015 
00016 #include "config.h"
00017 
00018 #if defined(ENABLE_LOGGING)
00019 
00020 #include "DigiLogger.h"
00021 
00022 #define digi_log(...)  DigiLog::DigiLogger::log_format(__VA_ARGS__);
00023 #else
00024 #define digi_log(...)  do {} while(0)
00025 #endif
00026 
00027 #if defined(ENABLE_ASSERTIONS)
00028 #include "mbed.h"
00029 #if !(defined assert)
00030 #define assert(expr)            if (!(expr)) {                                      \
00031                                     digi_log(LogLevelNone, "Assertion failed: %s, file %s, line %d\n", \
00032                                          #expr, __FILE__, __LINE__);                \
00033                                     mbed_die();                                     \
00034                                 }
00035 #endif
00036 #else
00037 #define assert(expr)
00038 #endif
00039 
00040 #endif /* __DEBUG_H_ */