app descriptor rename
This commit is contained in:
@@ -83,7 +83,7 @@ static hidd_class_driver_t const hidd_class_driver[HIDD_NUMBER_OF_SUBCLASS] =
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
[HID_PROTOCOL_KEYBOARD] =
|
||||
{
|
||||
.p_report_desc = app_tusb_keyboard_desc_report,
|
||||
.p_report_desc = tusbd_hid_keyboard_descriptor_report,
|
||||
.p_interface = &keyboardd_data,
|
||||
.mounted_cb = tusbd_hid_keyboard_mounted_cb,
|
||||
.unmounted_cb = tusbd_hid_keyboard_unmounted_cb,
|
||||
@@ -96,7 +96,7 @@ static hidd_class_driver_t const hidd_class_driver[HIDD_NUMBER_OF_SUBCLASS] =
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
[HID_PROTOCOL_MOUSE] =
|
||||
{
|
||||
.p_report_desc = app_tusb_mouse_desc_report,
|
||||
.p_report_desc = tusbd_hid_mouse_descriptor_report,
|
||||
.p_interface = &moused_data,
|
||||
.mounted_cb = tusbd_hid_mouse_mounted_cb,
|
||||
.unmounted_cb = tusbd_hid_mouse_unmounted_cb,
|
||||
@@ -183,10 +183,7 @@ void hidd_close(uint8_t coreid)
|
||||
for(uint8_t i=0; i<HIDD_NUMBER_OF_SUBCLASS; i++)
|
||||
{
|
||||
interface_clear(hidd_class_driver[i].p_interface);
|
||||
if ( hidd_class_driver[i].unmounted_cb )
|
||||
{
|
||||
hidd_class_driver[i].unmounted_cb(coreid);
|
||||
}
|
||||
if ( hidd_class_driver[i].unmounted_cb ) hidd_class_driver[i].unmounted_cb(coreid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,10 +193,7 @@ tusb_error_t hidd_control_request_subtask(uint8_t coreid, tusb_control_request_t
|
||||
for(subclass_idx=0; subclass_idx<HIDD_NUMBER_OF_SUBCLASS; subclass_idx++)
|
||||
{
|
||||
hidd_interface_t * const p_interface = hidd_class_driver[subclass_idx].p_interface;
|
||||
if ( (p_interface != NULL) && (p_request->wIndex == p_interface->interface_number) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
if ( (p_interface != NULL) && (p_request->wIndex == p_interface->interface_number) ) break;
|
||||
}
|
||||
|
||||
ASSERT(subclass_idx < HIDD_NUMBER_OF_SUBCLASS, TUSB_ERROR_FAILED);
|
||||
|
||||
+7
-12
@@ -54,7 +54,6 @@
|
||||
//--------------------------------------------------------------------+
|
||||
usbd_device_info_t usbd_devices[CONTROLLER_DEVICE_NUMBER];
|
||||
|
||||
// TODO fix/compress number of class driver
|
||||
static usbd_class_driver_t const usbd_class_drivers[] =
|
||||
{
|
||||
#if DEVICE_CLASS_HID
|
||||
@@ -92,9 +91,7 @@ static usbd_class_driver_t const usbd_class_drivers[] =
|
||||
|
||||
};
|
||||
|
||||
enum {
|
||||
USBD_CLASS_DRIVER_COUNT = sizeof(usbd_class_drivers) / sizeof(usbd_class_driver_t)
|
||||
};
|
||||
enum { USBD_CLASS_DRIVER_COUNT = sizeof(usbd_class_drivers) / sizeof(usbd_class_driver_t) };
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INTERNAL OBJECT & FUNCTION DECLARATION
|
||||
@@ -115,9 +112,7 @@ bool tusbd_is_configured(uint8_t coreid)
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
//------------- OSAL Task -------------//
|
||||
enum {
|
||||
USBD_TASK_QUEUE_DEPTH = 8
|
||||
};
|
||||
enum { USBD_TASK_QUEUE_DEPTH = 8 };
|
||||
|
||||
typedef enum {
|
||||
USBD_EVENTID_SETUP_RECEIVED = 1,
|
||||
@@ -298,7 +293,7 @@ static tusb_error_t usbd_set_configure_received(uint8_t coreid, uint8_t config_n
|
||||
usbd_devices[coreid].state = TUSB_DEVICE_STATE_CONFIGURED;
|
||||
|
||||
//------------- parse configuration & open drivers -------------//
|
||||
uint8_t* p_desc_configure = (uint8_t*) &app_tusb_desc_configuration;
|
||||
uint8_t* p_desc_configure = (uint8_t*) &tusbd_descriptor_configuration;
|
||||
uint8_t* p_desc = p_desc_configure + sizeof(tusb_descriptor_configuration_t);
|
||||
|
||||
while( p_desc < p_desc_configure + ((tusb_descriptor_configuration_t*)p_desc_configure)->wTotalLength )
|
||||
@@ -338,19 +333,19 @@ static tusb_error_t get_descriptor(uint8_t coreid, tusb_control_request_t const
|
||||
|
||||
if ( TUSB_DESC_TYPE_DEVICE == desc_type )
|
||||
{
|
||||
(*pp_buffer) = (uint8_t *) &app_tusb_desc_device;
|
||||
(*pp_buffer) = (uint8_t *) &tusbd_descriptor_device;
|
||||
(*p_length) = sizeof(tusb_descriptor_device_t);
|
||||
}
|
||||
else if ( TUSB_DESC_TYPE_CONFIGURATION == desc_type )
|
||||
{
|
||||
(*pp_buffer) = (uint8_t *) &app_tusb_desc_configuration;
|
||||
(*p_length) = sizeof(app_tusb_desc_configuration);
|
||||
(*pp_buffer) = (uint8_t *) &tusbd_descriptor_configuration;
|
||||
(*p_length) = sizeof(tusbd_descriptor_configuration);
|
||||
}
|
||||
else if ( TUSB_DESC_TYPE_STRING == desc_type )
|
||||
{
|
||||
if ( ! (desc_index < TUSB_CFG_DEVICE_STRING_DESCRIPTOR_COUNT) ) return TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT;
|
||||
|
||||
(*pp_buffer) = (uint8_t *) tusbd_string_desc_table[desc_index];
|
||||
(*pp_buffer) = (uint8_t *) tusbd_descriptor_string_table[desc_index];
|
||||
(*p_length) = **pp_buffer;
|
||||
}else
|
||||
{
|
||||
|
||||
+3
-7
@@ -52,9 +52,6 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF
|
||||
//--------------------------------------------------------------------+
|
||||
#define ENUM_QUEUE_DEPTH 5
|
||||
|
||||
// TODO fix/compress number of class driver
|
||||
static host_class_driver_t const usbh_class_drivers[] =
|
||||
{
|
||||
#if HOST_CLASS_HID
|
||||
@@ -103,16 +100,15 @@ static host_class_driver_t const usbh_class_drivers[] =
|
||||
#endif
|
||||
};
|
||||
|
||||
enum {
|
||||
USBH_CLASS_DRIVER_COUNT = sizeof(usbh_class_drivers) / sizeof(host_class_driver_t)
|
||||
};
|
||||
enum { USBH_CLASS_DRIVER_COUNT = sizeof(usbh_class_drivers) / sizeof(host_class_driver_t) };
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INTERNAL OBJECT & FUNCTION DECLARATION
|
||||
//--------------------------------------------------------------------+
|
||||
TUSB_CFG_ATTR_USBRAM usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1]; // including zero-address
|
||||
|
||||
//------------- Enumeration Task Data -------------//
|
||||
//------------- Enumeration Task Data -------------/
|
||||
enum { ENUM_QUEUE_DEPTH = 5 };
|
||||
OSAL_TASK_DEF(usbh_enumeration_task, 200, TUSB_CFG_OS_TASK_PRIO);
|
||||
OSAL_QUEUE_DEF(enum_queue_def, ENUM_QUEUE_DEPTH, uint32_t);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user