summaryrefslogtreecommitdiff
path: root/examples/device/hid_composite/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-06-28 13:34:47 +0700
committerhathach <[email protected]>2022-06-28 13:34:47 +0700
commit83602ea1234e992dd90d6b3c9b1f0fd8b2bf5a78 (patch)
treee45dfa4187b262508636c64f882e23987b1c3c48 /examples/device/hid_composite/src
parent4057c2d8d96a364329d14d3a4b2c237f388cfdc2 (diff)
parent3ead682af05bee3a275125f3e0384dd9b2882546 (diff)
Merge branch 'master' into rp2040_warning
Diffstat (limited to 'examples/device/hid_composite/src')
-rw-r--r--examples/device/hid_composite/src/main.c2
-rw-r--r--examples/device/hid_composite/src/usb_descriptors.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/device/hid_composite/src/main.c b/examples/device/hid_composite/src/main.c
index cc3566ac1..3a3839a1a 100644
--- a/examples/device/hid_composite/src/main.c
+++ b/examples/device/hid_composite/src/main.c
@@ -225,7 +225,7 @@ void hid_task(void)
// Invoked when sent REPORT successfully to host
// Application can use this to send the next report
// Note: For composite reports, report[0] is report ID
-void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, uint8_t len)
+void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, uint16_t len)
{
(void) instance;
(void) len;
diff --git a/examples/device/hid_composite/src/usb_descriptors.c b/examples/device/hid_composite/src/usb_descriptors.c
index e760b20ba..2988baee2 100644
--- a/examples/device/hid_composite/src/usb_descriptors.c
+++ b/examples/device/hid_composite/src/usb_descriptors.c
@@ -210,7 +210,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
const char* str = string_desc_arr[index];
// Cap at max char
- chr_count = strlen(str);
+ chr_count = (uint8_t) strlen(str);
if ( chr_count > 31 ) chr_count = 31;
// Convert ASCII string into UTF-16
@@ -221,7 +221,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
}
// first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
+ _desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8 ) | (2*chr_count + 2));
return _desc_str;
}