Norimasa Okamoto / Mbed 2 deprecated USBMSD_LPC_HelloWorld

Dependencies:   SWD USBDevice mbed BaseDAP

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mydebug.h Source File

mydebug.h

00001 // mydebug.h 2013/9/26
00002 #pragma once
00003 
00004 #ifdef MY_DEBUG
00005 #include "mbed_debug.h"
00006 extern void debug_hex(uint8_t* buf, int len);
00007 #define DBG(x, ...) debug("[%s:%d]"x"\r\n", __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
00008 #define DBG_HEX(A,B) do{debug("[%s:%d]\r\n",__PRETTY_FUNCTION__, __LINE__);debug_hex(A,B);}while(0);
00009 #else
00010 #define DBG(x, ...) while(0);
00011 #define DBG_HEX(A,B) while(0);
00012 #endif
00013 
00014 #if 1
00015 #include "mbed_debug.h"
00016 #define TEST_ASSERT(A) while(!(A)){debug("\n\n%s@%d %s ASSERT!\n\n",__PRETTY_FUNCTION__,__LINE__,#A);exit(1);};
00017 #else
00018 #define TEST_ASSERT(A) while(0);
00019 #endif
00020 
00021 #ifndef CT_ASSERT
00022 template <bool>struct CtAssert;
00023 template <>struct CtAssert<true> {};
00024 #define CT_ASSERT(A) CtAssert<A>();
00025 #endif //CT_ASSERT