From 8c930eeb9cb5c0951d143e2abceb6241346a9fb9 Mon Sep 17 00:00:00 2001 From: HalfSweet Date: Sat, 28 Sep 2024 21:28:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dhid=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/HSLink-Pro/src/HID_COMM/hid_comm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/projects/HSLink-Pro/src/HID_COMM/hid_comm.c b/projects/HSLink-Pro/src/HID_COMM/hid_comm.c index bd82936..9983653 100644 --- a/projects/HSLink-Pro/src/HID_COMM/hid_comm.c +++ b/projects/HSLink-Pro/src/HID_COMM/hid_comm.c @@ -4,13 +4,13 @@ #include "hid_comm.h" #include "usbd_core.h" - #include "dap_main.h" +#ifdef CONFIG_USE_HID_CONFIG + USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t read_buffer[HID_PACKET_SIZE]; USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t write_buffer[HID_PACKET_SIZE]; -#ifdef CONFIG_USE_HID_CONFIG /*!< custom hid report descriptor */ const uint8_t hid_custom_report_desc[HID_CUSTOM_REPORT_DESC_SIZE] = { /* USER CODE BEGIN 0 */ @@ -44,18 +44,15 @@ const uint8_t hid_custom_report_desc[HID_CUSTOM_REPORT_DESC_SIZE] = { /* USER CODE END 0 */ 0xC0 /* END_COLLECTION */ }; -#endif -#ifdef CONFIG_USE_HID_CONFIG - -__WEAK void usbd_hid_custom_in_callback(uint8_t busid, uint8_t ep, uint32_t nbytes) +void usbd_hid_custom_in_callback(uint8_t busid, uint8_t ep, uint32_t nbytes) { (void) busid; USB_LOG_RAW("actual in len:%d\r\n", nbytes); // custom_state = HID_STATE_IDLE; } -__WEAK void usbd_hid_custom_out_callback(uint8_t busid, uint8_t ep, uint32_t nbytes) +void usbd_hid_custom_out_callback(uint8_t busid, uint8_t ep, uint32_t nbytes) { (void) busid; USB_LOG_RAW("actual out len:%d\r\n", nbytes); @@ -73,5 +70,5 @@ struct usbd_endpoint hid_custom_out_ep = { .ep_cb = usbd_hid_custom_out_callback, .ep_addr = HID_OUT_EP }; -#endif +#endif