Adaptation of the official mbed USBHost repository to work with the LPC4088 Display Module
Dependents: DMSupport DMSupport DMSupport DMSupport
Fork of DM_USBHost by
Diff: USBHost/dbg.h
- Revision:
- 27:aa2fd412f1d3
- Parent:
- 19:bd46ea19486b
diff -r 607951c26872 -r aa2fd412f1d3 USBHost/dbg.h --- a/USBHost/dbg.h Mon Aug 18 13:45:26 2014 +0100 +++ b/USBHost/dbg.h Tue Dec 02 15:16:39 2014 +0000 @@ -17,50 +17,54 @@ #ifndef USB_DEBUG_H #define USB_DEBUG_H +#include "DMBoard.h" // To replace the std::printf calls + //Debug is disabled by default -#define DEBUG 3 /*INFO,ERR,WARN*/ +#define DEBUG 2 /*ERR,WARN*/ #define DEBUG_TRANSFER 0 #define DEBUG_EP_STATE 0 #define DEBUG_EVENT 0 #if (DEBUG > 3) -#define USB_DBG(x, ...) std::printf("[USB_DBG: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); +#define USB_DBG(x, ...) DMBoard::instance().logger()->printf("[USB_DBG: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) +#define USB_DBG_X(...) DMBoard::instance().logger()->printf(__VA_ARGS__) #else #define USB_DBG(x, ...) #endif #if (DEBUG > 2) -#define USB_INFO(x, ...) std::printf("[USB_INFO: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); +#define USB_INFO(x, ...) DMBoard::instance().logger()->printf("[USB_INFO: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) #else #define USB_INFO(x, ...) #endif #if (DEBUG > 1) -#define USB_WARN(x, ...) std::printf("[USB_WARNING: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); +#define USB_WARN(x, ...) DMBoard::instance().logger()->printf("[USB_WARNING: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) #else #define USB_WARN(x, ...) #endif #if (DEBUG > 0) -#define USB_ERR(x, ...) std::printf("[USB_ERR: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); +#define USB_ERR(x, ...) DMBoard::instance().logger()->printf("[USB_ERR: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) #else #define USB_ERR(x, ...) #endif #if (DEBUG_TRANSFER) -#define USB_DBG_TRANSFER(x, ...) std::printf("[USB_TRANSFER: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); +#define USB_DBG_TRANSFER(x, ...) DMBoard::instance().logger()->printf("[USB_TRANSFER: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) #else #define USB_DBG_TRANSFER(x, ...) #endif #if (DEBUG_EVENT) -#define USB_DBG_EVENT(x, ...) std::printf("[USB_EVENT: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); +#define USB_DBG_EVENT(x, ...) DMBoard::instance().logger()->printf("[USB_EVENT: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__) #else #define USB_DBG_EVENT(x, ...) #endif +void assert_mem_region(uint32_t ptr); +#define ASSERT_MEM_REGION(__x) assert_mem_region((uint32_t)(__x)) + #endif - -