summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-08-01 16:28:53 +0700
committerGitHub <[email protected]>2019-08-01 16:28:53 +0700
commit3f4adda5559442cd0cc73cae3b789af6c33b9583 (patch)
tree943c809c6fbb5447e4f799b7d73feeb9da2eab1e /examples
parent2c2db31b095724fc8fc914f3c07641765ee0dc90 (diff)
parentf133fbbe1f3635ed77135330f48d6f1ba850b341 (diff)
Merge pull request #90 from hathach/develop
update from Develop
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_hid/src/msc_disk.c4
-rw-r--r--examples/device/cdc_msc_hid/src/usb_descriptors.c4
-rw-r--r--examples/device/cdc_msc_hid_freertos/src/usb_descriptors.c4
-rw-r--r--examples/device/hid_generic_inout/src/usb_descriptors.c4
-rw-r--r--examples/device/midi_test/src/usb_descriptors.c4
-rw-r--r--examples/device/msc_dual_lun/src/usb_descriptors.c4
-rw-r--r--examples/device/webusb_serial/src/usb_descriptors.c4
7 files changed, 14 insertions, 14 deletions
diff --git a/examples/device/cdc_msc_hid/src/msc_disk.c b/examples/device/cdc_msc_hid/src/msc_disk.c
index be99a2391..406baf719 100644
--- a/examples/device/cdc_msc_hid/src/msc_disk.c
+++ b/examples/device/cdc_msc_hid/src/msc_disk.c
@@ -63,7 +63,7 @@ uint8_t msc_disk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
0x01, 0x10, 0x00, 0x10, 0x00, 0xF8, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x29, 0x34, 0x12, 0x00, 0x00, 'T' , 'i' , 'n' , 'y' , 'U' ,
'S' , 'B' , ' ' , 'M' , 'S' , 'C' , 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00,
-
+
// Zero up to 2 last bytes of FAT magic code
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -91,7 +91,7 @@ uint8_t msc_disk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/examples/device/cdc_msc_hid/src/usb_descriptors.c b/examples/device/cdc_msc_hid/src/usb_descriptors.c
index ee79f4ece..34f391dfb 100644
--- a/examples/device/cdc_msc_hid/src/usb_descriptors.c
+++ b/examples/device/cdc_msc_hid/src/usb_descriptors.c
@@ -209,8 +209,8 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index)
}
}
- // first byte is len, second byte is string type
- _desc_str[0] = TUD_DESC_STR_HEADER(chr_count);
+ // first byte is length (including header), second byte is string type
+ _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
return _desc_str;
}
diff --git a/examples/device/cdc_msc_hid_freertos/src/usb_descriptors.c b/examples/device/cdc_msc_hid_freertos/src/usb_descriptors.c
index 699067f73..5d93cc2f6 100644
--- a/examples/device/cdc_msc_hid_freertos/src/usb_descriptors.c
+++ b/examples/device/cdc_msc_hid_freertos/src/usb_descriptors.c
@@ -210,8 +210,8 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index)
}
}
- // first byte is len, second byte is string type
- _desc_str[0] = TUD_DESC_STR_HEADER(chr_count);
+ // first byte is length (including header), second byte is string type
+ _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
return _desc_str;
}
diff --git a/examples/device/hid_generic_inout/src/usb_descriptors.c b/examples/device/hid_generic_inout/src/usb_descriptors.c
index 7578a8b7f..c9493c4e6 100644
--- a/examples/device/hid_generic_inout/src/usb_descriptors.c
+++ b/examples/device/hid_generic_inout/src/usb_descriptors.c
@@ -162,8 +162,8 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index)
}
}
- // first byte is len, second byte is string type
- _desc_str[0] = TUD_DESC_STR_HEADER(chr_count);
+ // first byte is length (including header), second byte is string type
+ _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
return _desc_str;
}
diff --git a/examples/device/midi_test/src/usb_descriptors.c b/examples/device/midi_test/src/usb_descriptors.c
index 95d3cca25..7cebc6a15 100644
--- a/examples/device/midi_test/src/usb_descriptors.c
+++ b/examples/device/midi_test/src/usb_descriptors.c
@@ -149,8 +149,8 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index)
}
}
- // first byte is len, second byte is string type
- _desc_str[0] = TUD_DESC_STR_HEADER(chr_count);
+ // first byte is length (including header), second byte is string type
+ _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
return _desc_str;
}
diff --git a/examples/device/msc_dual_lun/src/usb_descriptors.c b/examples/device/msc_dual_lun/src/usb_descriptors.c
index 6064d8d7b..cab37cf1f 100644
--- a/examples/device/msc_dual_lun/src/usb_descriptors.c
+++ b/examples/device/msc_dual_lun/src/usb_descriptors.c
@@ -147,8 +147,8 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index)
}
}
- // first byte is len, second byte is string type
- _desc_str[0] = TUD_DESC_STR_HEADER(chr_count);
+ // first byte is length (including header), second byte is string type
+ _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
return _desc_str;
}
diff --git a/examples/device/webusb_serial/src/usb_descriptors.c b/examples/device/webusb_serial/src/usb_descriptors.c
index a61c62c93..a1d5cd9b9 100644
--- a/examples/device/webusb_serial/src/usb_descriptors.c
+++ b/examples/device/webusb_serial/src/usb_descriptors.c
@@ -230,8 +230,8 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index)
}
}
- // first byte is len, second byte is string type
- _desc_str[0] = TUD_DESC_STR_HEADER(chr_count);
+ // first byte is length (including header), second byte is string type
+ _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
return _desc_str;
}