diff options
| author | hathach <[email protected]> | 2022-06-27 11:50:17 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2022-06-27 11:50:17 +0700 |
| commit | b9dc9dbd78ee1890342429502d585f323c480fc2 (patch) | |
| tree | 922509c3012736c3b7b564c99d8c27ef77d60013 /examples/device/hid_boot_interface | |
| parent | 0042eccb3b2ff0f980f3a927a271364a2089ada5 (diff) | |
fix most warnings with rp2040 -wconversion
Diffstat (limited to 'examples/device/hid_boot_interface')
| -rw-r--r-- | examples/device/hid_boot_interface/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | examples/device/hid_boot_interface/src/usb_descriptors.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/examples/device/hid_boot_interface/CMakeLists.txt b/examples/device/hid_boot_interface/CMakeLists.txt index abc4d91da..438635958 100644 --- a/examples/device/hid_boot_interface/CMakeLists.txt +++ b/examples/device/hid_boot_interface/CMakeLists.txt @@ -23,6 +23,9 @@ target_include_directories(${PROJECT} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ) +# Example common such as compiler warnings +include(${CMAKE_CURRENT_SOURCE_DIR}/../../example.cmake) + # Configure compilation flags and libraries for the example... see the corresponding function # in hw/bsp/FAMILY/family.cmake for details. family_configure_device_example(${PROJECT})
\ No newline at end of file diff --git a/examples/device/hid_boot_interface/src/usb_descriptors.c b/examples/device/hid_boot_interface/src/usb_descriptors.c index 3fa48d98d..a0d7e9f15 100644 --- a/examples/device/hid_boot_interface/src/usb_descriptors.c +++ b/examples/device/hid_boot_interface/src/usb_descriptors.c @@ -163,7 +163,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 @@ -174,7 +174,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; } |
