summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-09-13 23:01:43 +0700
committerhathach <[email protected]>2013-09-13 23:01:43 +0700
commit67453b89f03e43408bf165f610aa62a63c000f1c (patch)
treed16a9b8ea03d4f26ac9873b0f9d783a5bcdaa819
parentad0ef2e266475c643b36cb34d3ab1b8876bb6ec2 (diff)
fix task def with cmsis rtx
-rw-r--r--tests/lpc18xx_43xx/test/host/host_helper.h2
-rw-r--r--tests/lpc18xx_43xx/test/host/usbh/test_usbh.c19
-rw-r--r--tinyusb/osal/osal_cmsis_rtx.h2
3 files changed, 12 insertions, 11 deletions
diff --git a/tests/lpc18xx_43xx/test/host/host_helper.h b/tests/lpc18xx_43xx/test/host/host_helper.h
index eecd03a8b..a81ce37d9 100644
--- a/tests/lpc18xx_43xx/test/host/host_helper.h
+++ b/tests/lpc18xx_43xx/test/host/host_helper.h
@@ -64,8 +64,8 @@ static inline void helper_class_close_expect(uint8_t dev_addr)
static inline void helper_usbh_init_expect(void)
{
osal_semaphore_create_IgnoreAndReturn( (osal_semaphore_handle_t) 0x1234);
- osal_task_create_IgnoreAndReturn(TUSB_ERROR_NONE);
osal_queue_create_IgnoreAndReturn( (osal_queue_handle_t) 0x4566 );
+ osal_task_create_IgnoreAndReturn(TUSB_ERROR_NONE);
osal_mutex_create_IgnoreAndReturn((osal_mutex_handle_t) 0x789a);
}
diff --git a/tests/lpc18xx_43xx/test/host/usbh/test_usbh.c b/tests/lpc18xx_43xx/test/host/usbh/test_usbh.c
index 9a1a03bb4..95e667a6a 100644
--- a/tests/lpc18xx_43xx/test/host/usbh/test_usbh.c
+++ b/tests/lpc18xx_43xx/test/host/usbh/test_usbh.c
@@ -87,26 +87,27 @@ void test_usbh_init_hcd_failed(void)
TEST_ASSERT_EQUAL(TUSB_ERROR_HCD_FAILED, usbh_init());
}
-void test_usbh_init_enum_task_create_failed(void)
+void test_usbh_init_enum_queue_create_failed(void)
{
hcd_init_ExpectAndReturn(TUSB_ERROR_NONE);
- osal_task_create_IgnoreAndReturn(TUSB_ERROR_OSAL_TASK_FAILED);
- TEST_ASSERT_EQUAL(TUSB_ERROR_OSAL_TASK_FAILED, usbh_init());
+ osal_queue_create_IgnoreAndReturn(NULL);
+ TEST_ASSERT_EQUAL(TUSB_ERROR_OSAL_QUEUE_FAILED, usbh_init());
}
-void test_usbh_init_enum_queue_create_failed(void)
+void test_usbh_init_enum_task_create_failed(void)
{
hcd_init_ExpectAndReturn(TUSB_ERROR_NONE);
- osal_task_create_IgnoreAndReturn(TUSB_ERROR_NONE);
- osal_queue_create_IgnoreAndReturn(NULL);
- TEST_ASSERT_EQUAL(TUSB_ERROR_OSAL_QUEUE_FAILED, usbh_init());
+ osal_queue_create_IgnoreAndReturn((osal_queue_handle_t) 0x1234);
+ osal_task_create_IgnoreAndReturn(TUSB_ERROR_OSAL_TASK_FAILED);
+ TEST_ASSERT_EQUAL(TUSB_ERROR_OSAL_TASK_FAILED, usbh_init());
}
+
void test_usbh_init_semaphore_create_failed(void)
{
hcd_init_ExpectAndReturn(TUSB_ERROR_NONE);
- osal_task_create_IgnoreAndReturn(TUSB_ERROR_NONE);
osal_queue_create_IgnoreAndReturn((osal_queue_handle_t) 0x1234);
+ osal_task_create_IgnoreAndReturn(TUSB_ERROR_NONE);
osal_semaphore_create_IgnoreAndReturn(NULL);
TEST_ASSERT_EQUAL(TUSB_ERROR_OSAL_SEMAPHORE_FAILED, usbh_init());
}
@@ -114,8 +115,8 @@ void test_usbh_init_semaphore_create_failed(void)
void test_usbh_init_mutex_create_failed(void)
{
hcd_init_ExpectAndReturn(TUSB_ERROR_NONE);
- osal_task_create_IgnoreAndReturn(TUSB_ERROR_NONE);
osal_queue_create_IgnoreAndReturn((osal_queue_handle_t) 0x1234);
+ osal_task_create_IgnoreAndReturn(TUSB_ERROR_NONE);
osal_semaphore_create_IgnoreAndReturn((osal_semaphore_handle_t) 0x1234);
osal_mutex_create_IgnoreAndReturn(NULL);
TEST_ASSERT_EQUAL(TUSB_ERROR_OSAL_MUTEX_FAILED, usbh_init());
diff --git a/tinyusb/osal/osal_cmsis_rtx.h b/tinyusb/osal/osal_cmsis_rtx.h
index 4381b1eb1..b2b2258f2 100644
--- a/tinyusb/osal/osal_cmsis_rtx.h
+++ b/tinyusb/osal/osal_cmsis_rtx.h
@@ -66,7 +66,7 @@
typedef osThreadDef_t osal_task_t;
-#define OSAL_TASK_DEF(task_name, task_code, task_stack_depth, task_prio) \
+#define OSAL_TASK_DEF(task_code, task_stack_depth, task_prio) \
osThreadDef(task_code, task_prio, 1, task_stack_depth*4) // stack depth is in bytes
#define OSAL_TASK_REF(task_name) osThread(task_name)