more hcd clean up

This commit is contained in:
hathach
2018-03-12 22:37:12 +07:00
parent c696812cad
commit 80398cb4cb
9 changed files with 48 additions and 46 deletions

View File

@@ -86,6 +86,7 @@
ENTRY(TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT )\
ENTRY(TUSB_ERROR_DCD_NOT_ENOUGH_QTD )\
ENTRY(TUSB_ERROR_DCD_OPEN_PIPE_FAILED )\
ENTRY(TUSB_ERROR_DCD_EDPT_XFER )\
ENTRY(TUSB_ERROR_NOT_SUPPORTED_YET )\
ENTRY(TUSB_ERROR_USBD_DEVICE_NOT_CONFIGURED )\
ENTRY(TUSB_ERROR_NOT_ENOUGH_MEMORY )\

View File

@@ -88,7 +88,7 @@ typedef enum
TUSB_DESC_DEBUG = 0x0A ,
TUSB_DESC_INTERFACE_ASSOCIATION = 0x0B ,
TUSB_DESC_CLASS_SPECIFIC = 0x24
}tusb_std_descriptor_type_t;
}tusb_desc_type_t;
typedef enum
{

View File

@@ -60,11 +60,11 @@
// VERIFY Helper
//--------------------------------------------------------------------+
#if TUSB_CFG_DEBUG >= 1
// #define VERIFY_MESS(format, ...) cprintf("[%08ld] %s: %d: verify failed\n", get_millis(), __func__, __LINE__)
#define VERIFY_MESS(_status) printf("%s: %d: verify failed, error = %s\n", __PRETTY_FUNCTION__, __LINE__, TUSB_ErrorStr[_status]);
// #define _VERIFY_MESS(format, ...) cprintf("[%08ld] %s: %d: verify failed\n", get_millis(), __func__, __LINE__)
#define _VERIFY_MESS(_status) printf("%s: %d: verify failed, error = %s\n", __PRETTY_FUNCTION__, __LINE__, TUSB_ErrorStr[_status]);
#define _ASSERT_MESS() printf("%s: %d: assert failed\n", __PRETTY_FUNCTION__, __LINE__);
#else
#define VERIFY_MESS(_status)
#define _VERIFY_MESS(_status)
#define _ASSERT_MESS()
#endif
@@ -82,13 +82,13 @@
#define VERIFY_STS_1ARGS(sts) \
do { \
uint32_t _status = (uint32_t)(sts); \
if ( 0 != _status ) { VERIFY_MESS(_status) return _status; } \
if ( 0 != _status ) { _VERIFY_MESS(_status) return _status; } \
} while(0)
#define VERIFY_STS_2ARGS(sts, _error) \
do { \
uint32_t _status = (uint32_t)(sts); \
if ( 0 != _status ) { VERIFY_MESS(_status) return _error; }\
if ( 0 != _status ) { _VERIFY_MESS(_status) return _error; }\
} while(0)
/**
@@ -106,13 +106,13 @@
#define VERIFY_STS_HDLR_2ARGS(sts, _handler) \
do { \
uint32_t _status = (uint32_t)(sts); \
if ( 0 != _status ) { VERIFY_MESS(_status) _handler; return _status; }\
if ( 0 != _status ) { _VERIFY_MESS(_status) _handler; return _status; }\
} while(0)
#define VERIFY_STS_HDLR_3ARGS(sts, _handler, _error) \
do { \
uint32_t _status = (uint32_t)(sts); \
if ( 0 != _status ) { VERIFY_MESS(_status) _handler; return _error; }\
if ( 0 != _status ) { _VERIFY_MESS(_status) _handler; return _error; }\
} while(0)
#define VERIFY_STATUS_HDLR(...) GET_4TH_ARG(__VA_ARGS__, VERIFY_STS_HDLR_3ARGS, VERIFY_STS_HDLR_2ARGS)(__VA_ARGS__)