fix bug with RNDIS class open using non-static variable p_cdc

fix bug with SUBTASK_EXIT with single if (add do while wrapper)
add payloay message
able to send initialize & wait on notification pipe & get initialize cmpt
This commit is contained in:
hathach
2013-07-05 20:21:24 +07:00
parent 355fd7e648
commit e4ae45359d
5 changed files with 101 additions and 43 deletions

View File

@@ -123,21 +123,23 @@ static inline volatile uint32_t osal_tick_get(void)
//--------------------------------------------------------------------+
//------------- Sub Task -------------//
#define OSAL_SUBTASK_INVOKED_AND_WAIT(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;\
}\
}while(0)
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;\
}\
}while(0)
#define OSAL_SUBTASK_BEGIN OSAL_TASK_LOOP_BEGIN
#define OSAL_SUBTASK_END OSAL_TASK_LOOP_END
//------------- Sub Task Assert -------------//
#define SUBTASK_EXIT(error) \
TASK_RESTART; return error
do {\
TASK_RESTART; return error;\
}while(0)
#define _SUBTASK_ASSERT_ERROR_HANDLER(error, func_call) \
func_call; TASK_RESTART; return error