USB composite device example program, drag-and-drop flash writer.
Dependencies: SWD USBDevice mbed BaseDAP
mydebug.h@1:ea8e179320d7, 2013-09-28 (annotated)
- Committer:
- va009039
- Date:
- Sat Sep 28 03:21:14 2013 +0000
- Revision:
- 1:ea8e179320d7
- Parent:
- 0:2385683c867a
add USBMSD_Drop class. add CDC(Virtual COM) and HID(for example CMSIS-DAP), but KL25Z not work.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
va009039 | 1:ea8e179320d7 | 1 | // mydebug.h 2013/9/26 |
va009039 | 0:2385683c867a | 2 | #pragma once |
va009039 | 0:2385683c867a | 3 | |
va009039 | 1:ea8e179320d7 | 4 | #ifdef MY_DEBUG |
va009039 | 0:2385683c867a | 5 | #include "mbed_debug.h" |
va009039 | 0:2385683c867a | 6 | extern void debug_hex(uint8_t* buf, int len); |
va009039 | 0:2385683c867a | 7 | #define DBG(x, ...) debug("[%s:%d]"x"\r\n", __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); |
va009039 | 0:2385683c867a | 8 | #define DBG_HEX(A,B) do{debug("[%s:%d]\r\n",__PRETTY_FUNCTION__, __LINE__);debug_hex(A,B);}while(0); |
va009039 | 0:2385683c867a | 9 | #else |
va009039 | 0:2385683c867a | 10 | #define DBG(x, ...) while(0); |
va009039 | 0:2385683c867a | 11 | #define DBG_HEX(A,B) while(0); |
va009039 | 0:2385683c867a | 12 | #endif |
va009039 | 0:2385683c867a | 13 | |
va009039 | 0:2385683c867a | 14 | #if 1 |
va009039 | 0:2385683c867a | 15 | #include "mbed_debug.h" |
va009039 | 0:2385683c867a | 16 | #define TEST_ASSERT(A) while(!(A)){debug("\n\n%s@%d %s ASSERT!\n\n",__PRETTY_FUNCTION__,__LINE__,#A);exit(1);}; |
va009039 | 0:2385683c867a | 17 | #else |
va009039 | 0:2385683c867a | 18 | #define TEST_ASSERT(A) while(0); |
va009039 | 0:2385683c867a | 19 | #endif |
va009039 | 1:ea8e179320d7 | 20 | |
va009039 | 1:ea8e179320d7 | 21 | #ifndef CT_ASSERT |
va009039 | 1:ea8e179320d7 | 22 | template <bool>struct CtAssert; |
va009039 | 1:ea8e179320d7 | 23 | template <>struct CtAssert<true> {}; |
va009039 | 1:ea8e179320d7 | 24 | #define CT_ASSERT(A) CtAssert<A>(); |
va009039 | 1:ea8e179320d7 | 25 | #endif //CT_ASSERT |