summaryrefslogtreecommitdiff
path: root/examples/dual
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-06-27 17:11:24 +0700
committerhathach <[email protected]>2022-06-27 17:11:24 +0700
commita0ef4898906a5985deae11e5539a942885398ca1 (patch)
treeccd2e31d599d4bb341c7b840e25a4bf8536fdda3 /examples/dual
parent6522a8150e22d47bacabd2f1f027452db2254984 (diff)
fix all warnings with host rp2040
Diffstat (limited to 'examples/dual')
-rw-r--r--examples/dual/host_hid_to_device_cdc/CMakeLists.txt4
-rw-r--r--examples/dual/host_hid_to_device_cdc/src/main.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/examples/dual/host_hid_to_device_cdc/CMakeLists.txt b/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
index ea4e087e3..cd6f16339 100644
--- a/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
+++ b/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
@@ -23,6 +23,10 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
+# Example common such as compiler warnings
+# skip extra warnings since pio-usb still has some warnings to fix
+#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_dual_usb_example(${PROJECT})
diff --git a/examples/dual/host_hid_to_device_cdc/src/main.c b/examples/dual/host_hid_to_device_cdc/src/main.c
index 6a25a28da..bd7870274 100644
--- a/examples/dual/host_hid_to_device_cdc/src/main.c
+++ b/examples/dual/host_hid_to_device_cdc/src/main.c
@@ -160,7 +160,7 @@ void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_re
char tempbuf[256];
int count = sprintf(tempbuf, "[%04x:%04x][%u] HID Interface%u, Protocol = %s\r\n", vid, pid, dev_addr, instance, protocol_str[itf_protocol]);
- tud_cdc_write(tempbuf, count);
+ tud_cdc_write(tempbuf, (uint32_t) count);
tud_cdc_write_flush();
// Receive report from boot keyboard & mouse only
@@ -179,7 +179,7 @@ void tuh_hid_umount_cb(uint8_t dev_addr, uint8_t instance)
{
char tempbuf[256];
int count = sprintf(tempbuf, "[%u] HID Interface%u is unmounted\r\n", dev_addr, instance);
- tud_cdc_write(tempbuf, count);
+ tud_cdc_write(tempbuf, (uint32_t) count);
tud_cdc_write_flush();
}
@@ -251,7 +251,7 @@ static void process_mouse_report(uint8_t dev_addr, hid_mouse_report_t const * re
char tempbuf[32];
int count = sprintf(tempbuf, "[%u] %c%c%c %d %d %d\r\n", dev_addr, l, m, r, report->x, report->y, report->wheel);
- tud_cdc_write(tempbuf, count);
+ tud_cdc_write(tempbuf, (uint32_t) count);
tud_cdc_write_flush();
}