add usbd_control_xfer_substak

seperate control xfer Data and Status phase
This commit is contained in:
hathach
2018-03-14 22:01:16 +07:00
parent 7707fe194f
commit 4a521711b9
4 changed files with 52 additions and 9 deletions

View File

@@ -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 ) { tusb_hal_dbg_breakpoint(); _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 ) { tusb_hal_dbg_breakpoint(); _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__)