improve usbd control transfer

This commit is contained in:
hathach
2018-03-22 14:15:16 +07:00
parent 17a227ca90
commit ce2fc0470c
8 changed files with 164 additions and 98 deletions

View File

@@ -107,19 +107,19 @@ static inline osal_task_t osal_task_create(osal_func_t code, const char* name, u
// SUBTASK (a sub function that uses OS blocking services & called by a task
//--------------------------------------------------------------------+
#define OSAL_SUBTASK_BEGIN OSAL_TASK_BEGIN
#define OSAL_SUBTASK_END \
default: TASK_RESTART; break; \
}}\
#define OSAL_SUBTASK_END \
default: TASK_RESTART; break; \
}} \
return TUSB_ERROR_NONE;
#define SUBTASK_INVOKE(_subtask, _status) \
do {\
_state = __LINE__; case __LINE__:\
{\
_status = _subtask; /* invoke sub task */\
if (TUSB_ERROR_OSAL_WAITING == _status) /* sub task not finished -> continue waiting */\
return TUSB_ERROR_OSAL_WAITING;\
}\
#define SUBTASK_INVOKE(_subtask, _status) \
do { \
_state = __LINE__; case __LINE__: \
{ \
(_status) = _subtask; /* invoke sub task */ \
if (TUSB_ERROR_OSAL_WAITING == (_status)) return TUSB_ERROR_OSAL_WAITING; \
} \
}while(0)
//------------- Sub Task Assert -------------//