mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
[lpc176x][device] get pass get string descriptors
This commit is contained in:
parent
cae19b8f56
commit
5ae9c72f84
@ -93,6 +93,24 @@ void std_get_descriptor(uint8_t coreid)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TUSB_DESC_TYPE_CONFIGURATION:
|
case TUSB_DESC_TYPE_CONFIGURATION:
|
||||||
|
{
|
||||||
|
uint16_t const requested_length = min16_of(usbd_devices[coreid].setup_packet.wLength, sizeof(app_tusb_desc_configuration)-1);
|
||||||
|
for(uint16_t i=0; i<requested_length; i += 64)
|
||||||
|
{
|
||||||
|
dcd_pipe_control_write(coreid, ((uint8_t*)&app_tusb_desc_configuration) + i, min16_of(64, requested_length - i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TUSB_DESC_TYPE_STRING:
|
||||||
|
{
|
||||||
|
uint8_t *p_string = (uint8_t*) &app_tusb_desc_strings;
|
||||||
|
for(uint8_t index =0; index < desc_index; index++)
|
||||||
|
{
|
||||||
|
p_string += (*p_string);
|
||||||
|
}
|
||||||
|
dcd_pipe_control_write(coreid, p_string, *p_string);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -131,7 +149,7 @@ tusb_error_t usbd_init (void)
|
|||||||
ASSERT_STATUS ( dcd_init() );
|
ASSERT_STATUS ( dcd_init() );
|
||||||
|
|
||||||
uint16_t length = 0;
|
uint16_t length = 0;
|
||||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
#if TUSB_CFG_DEVICE_HID_KEYBOARD && 0
|
||||||
ASSERT_STATUS( hidd_init(&app_tusb_desc_configuration.keyboard_interface, &length) );
|
ASSERT_STATUS( hidd_init(&app_tusb_desc_configuration.keyboard_interface, &length) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user