Kaynağa Gözat

fix task def with cmsis rtx

hathach 12 yıl önce
ebeveyn
işleme
67453b89f0

+ 1 - 1
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);
 }
 

+ 10 - 9
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());

+ 1 - 1
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)