USBHost library

Dependencies:   FATFileSystem mbed-rtos

Dependents:   AbitUSBModem_HTTPTest AbitUSBModem_MQTTTest AbitUSBModem_WebsocketTest AbitUSBModem_SMSTest

Fork of USBHost by mbed official

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dbg.h Source File

dbg.h

00001 /* mbed USBHost Library
00002  * Copyright (c) 2006-2013 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef USB_DEBUG_H
00018 #define USB_DEBUG_H
00019 
00020 //Debug is disabled by default
00021 #define DEBUG 3 /*INFO,ERR,WARN*/
00022 #define DEBUG_TRANSFER 0
00023 #define DEBUG_EP_STATE 0
00024 #define DEBUG_EVENT 0
00025 
00026 #if (DEBUG > 3)
00027 #define USB_DBG(x, ...) std::printf("[USB_DBG: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
00028 #else
00029 #define USB_DBG(x, ...)
00030 #endif
00031 
00032 #if (DEBUG > 2)
00033 #define USB_INFO(x, ...) std::printf("[USB_INFO: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
00034 #else
00035 #define USB_INFO(x, ...)
00036 #endif
00037 
00038 #if (DEBUG > 1)
00039 #define USB_WARN(x, ...) std::printf("[USB_WARNING: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
00040 #else
00041 #define USB_WARN(x, ...)
00042 #endif
00043 
00044 #if (DEBUG > 0)
00045 #define USB_ERR(x, ...) std::printf("[USB_ERR: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
00046 #else
00047 #define USB_ERR(x, ...)
00048 #endif
00049 
00050 #if (DEBUG_TRANSFER)
00051 #define USB_DBG_TRANSFER(x, ...) std::printf("[USB_TRANSFER: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
00052 #else
00053 #define USB_DBG_TRANSFER(x, ...)
00054 #endif
00055 
00056 #if (DEBUG_EVENT)
00057 #define USB_DBG_EVENT(x, ...) std::printf("[USB_EVENT: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
00058 #else
00059 #define USB_DBG_EVENT(x, ...)
00060 #endif
00061 
00062 
00063 #endif
00064 
00065 
00066