mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
house keeping
This commit is contained in:
parent
c24d461d19
commit
7fc3e4f8fe
@ -117,7 +117,7 @@ void test_usbh_status_get_succeed(void)
|
||||
//--------------------------------------------------------------------+
|
||||
// enum task
|
||||
//--------------------------------------------------------------------+
|
||||
extern osal_queue_handle_t enumeration_queue_hdl;
|
||||
extern osal_queue_handle_t enum_queue_hdl;
|
||||
usbh_enumerate_t enum_connect =
|
||||
{
|
||||
.core_id = 0,
|
||||
@ -128,7 +128,7 @@ usbh_enumerate_t enum_connect =
|
||||
|
||||
void queue_recv_stub (osal_queue_handle_t const queue_hdl, uint32_t *p_data, uint32_t msec, tusb_error_t *p_error, int num_call)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_PTR(enumeration_queue_hdl, queue_hdl);
|
||||
TEST_ASSERT_EQUAL_PTR(enum_queue_hdl, queue_hdl);
|
||||
memcpy(p_data, &enum_connect, 4);
|
||||
(*p_error) = TUSB_ERROR_NONE;
|
||||
}
|
||||
@ -138,7 +138,7 @@ void test_enum_task_connect(void)
|
||||
osal_queue_receive_StubWithCallback(queue_recv_stub);
|
||||
hcd_port_connect_status_ExpectAndReturn(enum_connect.core_id, true);
|
||||
|
||||
usbh_enumerate_task();
|
||||
usbh_enumeration_task();
|
||||
}
|
||||
|
||||
void test_enum_task_disconnect(void)
|
||||
|
@ -70,19 +70,19 @@ tusbh_device_status_t tusbh_device_status_get (tusb_handle_device_t const device
|
||||
//--------------------------------------------------------------------+
|
||||
// ENUMERATION TASK & ITS DATA
|
||||
//--------------------------------------------------------------------+
|
||||
OSAL_TASK_DEF(enumeration_task, usbh_enumerate_task, 128, OSAL_PRIO_HIGH);
|
||||
OSAL_TASK_DEF(enum_task, usbh_enumeration_task, 128, OSAL_PRIO_HIGH);
|
||||
|
||||
#define ENUM_QUEUE_DEPTH 5
|
||||
OSAL_DEF_QUEUE(enumeration_queue, ENUM_QUEUE_DEPTH, uin32_t);
|
||||
osal_queue_handle_t enumeration_queue_hdl;
|
||||
OSAL_DEF_QUEUE(enum_queue, ENUM_QUEUE_DEPTH, uin32_t);
|
||||
osal_queue_handle_t enum_queue_hdl;
|
||||
|
||||
void usbh_enumerate_task(void)
|
||||
void usbh_enumeration_task(void)
|
||||
{
|
||||
OSAL_TASK_LOOP
|
||||
{
|
||||
OSAL_TASK_LOOP_BEGIN
|
||||
|
||||
|
||||
// osal_queue_receive(enumeration_queue_hdl, )
|
||||
|
||||
OSAL_TASK_LOOP_END
|
||||
}
|
||||
@ -102,9 +102,9 @@ tusb_error_t usbh_init(void)
|
||||
ASSERT_STATUS( hcd_init(i) );
|
||||
}
|
||||
|
||||
ASSERT_STATUS( osal_task_create(&enumeration_task) );
|
||||
enumeration_queue_hdl = osal_queue_create(&enumeration_queue);
|
||||
ASSERT_PTR(enumeration_queue_hdl, TUSB_ERROR_OSAL_QUEUE_FAILED);
|
||||
ASSERT_STATUS( osal_task_create(&enum_task) );
|
||||
enum_queue_hdl = osal_queue_create(&enum_queue);
|
||||
ASSERT_PTR(enum_queue_hdl, TUSB_ERROR_OSAL_QUEUE_FAILED);
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user