diff options
| author | Rémi Berthoz <[email protected]> | 2026-01-14 19:51:01 +0100 |
|---|---|---|
| committer | Rémi Berthoz <[email protected]> | 2026-01-14 19:51:01 +0100 |
| commit | bd760e5e37cf8be0c6ac9be48eb9f3852e3a0424 (patch) | |
| tree | 4ad2c93a379929121004bf20ba0a504b3ceede01 /examples | |
| parent | c6fb438a3437c23a7ff931c4370154eade8cd960 (diff) | |
| parent | 5e6e9e6ad0cf7b49b3ed3b6d18c20be57afeef06 (diff) | |
Merge 'upstream/master' into device-class-printer
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/device/mtp/src/mtp_fs_example.c | 2 | ||||
| -rw-r--r-- | examples/dual/host_info_to_device_cdc/src/main.c | 7 | ||||
| -rw-r--r-- | examples/host/device_info/src/main.c | 9 |
3 files changed, 8 insertions, 10 deletions
diff --git a/examples/device/mtp/src/mtp_fs_example.c b/examples/device/mtp/src/mtp_fs_example.c index 7fd7db61b..60fc9f79e 100644 --- a/examples/device/mtp/src/mtp_fs_example.c +++ b/examples/device/mtp/src/mtp_fs_example.c @@ -557,7 +557,7 @@ static int32_t fs_send_object_info(tud_mtp_cb_data_t* cb_data) { return MTP_RESP_INVALID_STORAGE_ID; } - if (obj_info->parent_object != 0) { // not root + if (obj_info->parent_object != 0 && obj_info->parent_object != 0xFFFFFFFFu) { // not root fs_file_t* parent = fs_get_file(obj_info->parent_object); if (parent == NULL || 0u == parent->association_type) { return MTP_RESP_INVALID_PARENT_OBJECT; diff --git a/examples/dual/host_info_to_device_cdc/src/main.c b/examples/dual/host_info_to_device_cdc/src/main.c index 00d059b66..fffb54d58 100644 --- a/examples/dual/host_info_to_device_cdc/src/main.c +++ b/examples/dual/host_info_to_device_cdc/src/main.c @@ -246,10 +246,9 @@ static void print_device_info(uint8_t daddr, const tusb_desc_device_t* desc_devi cdc_printf("Device %u: ID %04x:%04x SN ", daddr, desc_device->idVendor, desc_device->idProduct); uint8_t xfer_result = tuh_descriptor_get_serial_string_sync(daddr, LANGUAGE_ID, serial, sizeof(serial)); if (XFER_RESULT_SUCCESS != xfer_result) { - serial[0] = 'n'; - serial[1] = '/'; - serial[2] = 'a'; - serial[3] = 0; + serial[0] = (uint16_t)((TUSB_DESC_STRING << 8) | (2 * 1 + 2)); + serial[1] = '0'; + serial[2] = 0; } print_utf16(serial, TU_ARRAY_SIZE(serial)); cdc_printf("\r\n"); diff --git a/examples/host/device_info/src/main.c b/examples/host/device_info/src/main.c index 5b914a2ee..ab617e989 100644 --- a/examples/host/device_info/src/main.c +++ b/examples/host/device_info/src/main.c @@ -130,11 +130,10 @@ void tuh_mount_cb(uint8_t daddr) { } if (XFER_RESULT_SUCCESS != xfer_result) { uint16_t* serial = (uint16_t*)(uintptr_t) desc.serial; - serial[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * 3 + 2)); - serial[1] = 'n'; - serial[2] = '/'; - serial[3] = 'a'; - serial[4] = 0; + + serial[0] = (uint16_t)((TUSB_DESC_STRING << 8) | (2 * 1 + 2)); + serial[1] = '0'; // simply 0 + serial[2] = 0; } print_utf16((uint16_t*)(uintptr_t) desc.serial, sizeof(desc.serial)/2); printf("\r\n"); |
