From 739d83a8a93642e4fe96cc30b69367242be2e5ae Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Mon, 14 Feb 2022 14:57:20 +0800 Subject: fix struct name due to copy error --- class/cdc/usbh_cdc_acm.c | 2 +- class/hid/usbh_hid.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'class') diff --git a/class/cdc/usbh_cdc_acm.c b/class/cdc/usbh_cdc_acm.c index f751ca9b..32ac41d9 100644 --- a/class/cdc/usbh_cdc_acm.c +++ b/class/cdc/usbh_cdc_acm.c @@ -172,7 +172,7 @@ USB_NOCACHE_RAM_SECTION uint8_t cdc_buffer[4096]; void usbh_cdc_acm_callback(void *arg, int nbytes) { - struct usbh_hub *cdc_acm_class = (struct usbh_hub *)arg; + struct usbh_cdc_acm *cdc_acm_class = (struct usbh_cdc_acm *)arg; if (nbytes > 0) { for (size_t i = 0; i < nbytes; i++) { diff --git a/class/hid/usbh_hid.c b/class/hid/usbh_hid.c index f047267a..7fee5a9b 100644 --- a/class/hid/usbh_hid.c +++ b/class/hid/usbh_hid.c @@ -159,15 +159,15 @@ int usbh_hid_get_idle(struct usbh_hubport *hport, uint8_t intf, uint8_t *buffer) return 0; } -USB_NOCACHE_RAM_SECTION uint8_t report_buffer[128]; +USB_NOCACHE_RAM_SECTION uint8_t hid_buffer[128]; void usbh_hid_callback(void *arg, int nbytes) { - struct usbh_hub *hid_class = (struct usbh_hub *)arg; + struct usbh_hid *hid_class = (struct usbh_hid *)arg; if (nbytes > 0) { for (size_t i = 0; i < nbytes; i++) { - printf("0x%02x ", report_buffer[i]); + printf("0x%02x ", hid_buffer[i]); } } @@ -205,7 +205,7 @@ int usbh_hid_connect(struct usbh_hubport *hport, uint8_t intf) return ret; } - ret = usbh_hid_get_report_descriptor(hport, intf, report_buffer); + ret = usbh_hid_get_report_descriptor(hport, intf, hid_buffer); if (ret < 0) { return ret; } @@ -227,12 +227,12 @@ int usbh_hid_connect(struct usbh_hubport *hport, uint8_t intf) USB_LOG_INFO("Register HID Class:%s\r\n", devname); #if 1 - ret = usbh_ep_intr_async_transfer(hid_class->intin, report_buffer, 128, usbh_hid_callback, hid_class); + ret = usbh_ep_intr_async_transfer(hid_class->intin, hid_buffer, 128, usbh_hid_callback, hid_class); if (ret < 0) { return ret; } #else - ret = usbh_ep_intr_transfer(hid_class->intin, report_buffer, 128); + ret = usbh_ep_intr_transfer(hid_class->intin, hid_buffer, 128); if (ret < 0) { return ret; } -- cgit v1.3.1