summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-04-24 12:20:56 +0700
committerhathach <[email protected]>2013-04-24 12:20:56 +0700
commitd312be700636258060765b63a5ea4f73aaa5500a (patch)
tree002a7c9daf2589ab36c7a10e0dca00749fd3c712 /tests
parent73d5f00a40dcdc9a84e0f915d0ff349f231444c6 (diff)
fix potential error with usbh_control_xfer_subtask in subtask_assert
change back to use task_assert style in usbh_enumeraion change test to task->subtask->subtask style in test/test_osal_none.c
Diffstat (limited to 'tests')
-rw-r--r--tests/test/test_osal_none.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/tests/test/test_osal_none.c b/tests/test/test_osal_none.c
index e9c1eb160..aebf1545b 100644
--- a/tests/test/test_osal_none.c
+++ b/tests/test/test_osal_none.c
@@ -241,26 +241,48 @@ void flow_control_error_handler(void)
statements[5]++;
}
-tusb_error_t sample_task_flow_control(void)
+tusb_error_t sample_flow_control_subtask2(void)
{
tusb_error_t error;
- OSAL_TASK_LOOP_BEGIN
+ OSAL_SUBTASK_BEGIN
statements[0]++;
osal_semaphore_wait(sem_hdl, OSAL_TIMEOUT_NORMAL, &error);
- TASK_ASSERT(TUSB_ERROR_NONE == error);
+ SUBTASK_ASSERT(TUSB_ERROR_NONE == error);
statements[1]++;
osal_semaphore_wait(sem_hdl, OSAL_TIMEOUT_NORMAL, &error);
- TASK_ASSERT_STATUS(error);
+ SUBTASK_ASSERT_STATUS(error);
statements[2]++;
osal_semaphore_wait(sem_hdl, OSAL_TIMEOUT_NORMAL, &error);
- TASK_ASSERT_STATUS_WITH_HANDLER(error, flow_control_error_handler());
+ SUBTASK_ASSERT_STATUS_WITH_HANDLER(error, flow_control_error_handler());
statements[3]++;
+ OSAL_SUBTASK_END
+}
+
+tusb_error_t sample_flow_control_subtask(void)
+{
+ tusb_error_t error;
+
+ OSAL_SUBTASK_BEGIN
+
+ OSAL_SUBTASK_INVOKED_AND_WAIT (sample_flow_control_subtask2());
+
+ OSAL_SUBTASK_END
+}
+
+tusb_error_t sample_task_flow_control(void)
+{
+ tusb_error_t error;
+
+ OSAL_TASK_LOOP_BEGIN
+
+ OSAL_SUBTASK_INVOKED_AND_WAIT ( sample_flow_control_subtask() );
+
OSAL_TASK_LOOP_END
}