summaryrefslogtreecommitdiff
path: root/examples/host/bare_api/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-03-18 13:38:30 +0700
committerhathach <[email protected]>2022-03-18 13:38:30 +0700
commit2ff8978dde779607ddf01ba8e9d8dfeb70bfbd03 (patch)
tree1efce6db4659a608c6be1baa09d04a19fd24c5bd /examples/host/bare_api/src
parent85c6d6d37d3696680b650e211ef8dd279b1f9f26 (diff)
update sync API, move timeout into xfer struct
remove tuh_control_xfer_sync()
Diffstat (limited to 'examples/host/bare_api/src')
-rw-r--r--examples/host/bare_api/src/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/host/bare_api/src/main.c b/examples/host/bare_api/src/main.c
index feb94a6fe..b472c40c4 100644
--- a/examples/host/bare_api/src/main.c
+++ b/examples/host/bare_api/src/main.c
@@ -136,11 +136,10 @@ void print_device_descriptor(uint8_t daddr, tuh_xfer_t* xfer)
printf(" idProduct 0x%04x\r\n" , desc_device.idProduct);
printf(" bcdDevice %04x\r\n" , desc_device.bcdDevice);
- uint32_t timeout_ms = 10;
uint16_t temp_buf[128];
printf(" iManufacturer %u " , desc_device.iManufacturer);
- if (XFER_RESULT_SUCCESS == tuh_descriptor_get_manufacturer_string_sync(daddr, LANGUAGE_ID, temp_buf, TU_ARRAY_SIZE(temp_buf), timeout_ms) )
+ if (XFER_RESULT_SUCCESS == tuh_descriptor_get_manufacturer_string_sync(daddr, LANGUAGE_ID, temp_buf, TU_ARRAY_SIZE(temp_buf)) )
{
utf16_to_utf8(temp_buf, TU_ARRAY_SIZE(temp_buf));
printf((const char*) temp_buf);
@@ -148,7 +147,7 @@ void print_device_descriptor(uint8_t daddr, tuh_xfer_t* xfer)
printf("\r\n");
printf(" iProduct %u " , desc_device.iProduct);
- if (XFER_RESULT_SUCCESS == tuh_descriptor_get_product_string_sync(daddr, LANGUAGE_ID, temp_buf, TU_ARRAY_SIZE(temp_buf), timeout_ms))
+ if (XFER_RESULT_SUCCESS == tuh_descriptor_get_product_string_sync(daddr, LANGUAGE_ID, temp_buf, TU_ARRAY_SIZE(temp_buf)))
{
utf16_to_utf8(temp_buf, TU_ARRAY_SIZE(temp_buf));
printf((const char*) temp_buf);
@@ -156,7 +155,7 @@ void print_device_descriptor(uint8_t daddr, tuh_xfer_t* xfer)
printf("\r\n");
printf(" iSerialNumber %u " , desc_device.iSerialNumber);
- if (XFER_RESULT_SUCCESS == tuh_descriptor_get_serial_string_sync(daddr, LANGUAGE_ID, temp_buf, TU_ARRAY_SIZE(temp_buf), timeout_ms))
+ if (XFER_RESULT_SUCCESS == tuh_descriptor_get_serial_string_sync(daddr, LANGUAGE_ID, temp_buf, TU_ARRAY_SIZE(temp_buf)))
{
utf16_to_utf8(temp_buf, TU_ARRAY_SIZE(temp_buf));
printf((const char*) temp_buf);