From 44ab01fd5f1aaa58ba9f191e5c57b8baf900677b Mon Sep 17 00:00:00 2001 From: chxiao Date: Tue, 28 Nov 2023 16:45:16 +0800 Subject: [PATCH] Fixed device hid receiver save position issue. --- .../src/ux_device_class_hid_receiver_tasks_run.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c index a90e3cf..9531efe 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_receiver_tasks_run PORTABLE C */ -/* 6.3.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,9 @@ /* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ /* resulting in version 6.3.0 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed save position issue, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_receiver_tasks_run(UX_SLAVE_CLASS_HID *hid) @@ -165,6 +168,9 @@ ULONG temp; return(UX_STATE_NEXT); } + /* Get current save position. */ + pos = receiver -> ux_device_class_hid_receiver_event_save_pos; + #if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_HID_ZERO_COPY) /* Save received event length. */ @@ -172,7 +178,6 @@ ULONG temp; #else /* Save received event data and length. */ - pos = receiver -> ux_device_class_hid_receiver_event_save_pos; buffer = (UCHAR *)&pos -> ux_device_class_hid_received_event_data; temp = transfer -> ux_slave_transfer_request_actual_length; _ux_utility_memory_copy(buffer,