move daddr into xfer struct

This commit is contained in:
hathach
2022-03-18 16:39:35 +07:00
parent 2ff8978dde
commit 8750e3b577
7 changed files with 132 additions and 99 deletions

View File

@@ -115,7 +115,7 @@ static void utf16_to_utf8(uint16_t *temp_buf, size_t buf_len) {
((uint8_t*) temp_buf)[utf8_len] = '\0';
}
void print_device_descriptor(uint8_t daddr, tuh_xfer_t* xfer)
void print_device_descriptor(tuh_xfer_t* xfer)
{
if ( XFER_RESULT_SUCCESS != xfer->result )
{
@@ -123,6 +123,8 @@ void print_device_descriptor(uint8_t daddr, tuh_xfer_t* xfer)
return;
}
uint8_t const daddr = xfer->daddr;
printf("Device %u: ID %04x:%04x\r\n", daddr, desc_device.idVendor, desc_device.idProduct);
printf("Device Descriptor:\r\n");
printf(" bLength %u\r\n" , desc_device.bLength);