diff options
| author | Scott Larson <[email protected]> | 2020-10-09 12:39:54 -0700 |
|---|---|---|
| committer | Scott Larson <[email protected]> | 2020-10-09 12:39:54 -0700 |
| commit | 3f1e20df866441bd7e3e8a45fffe1d5ab0413002 (patch) | |
| tree | a4fd231c2da5829f8913d0c92d633e4173f2fa33 /common/usbx_host_classes/src/ux_host_class_pima_read.c | |
| parent | ed83d6f07d3ef30993be946b5889aaba816b1f17 (diff) | |
6.1 Releasev6.1_rel
Diffstat (limited to 'common/usbx_host_classes/src/ux_host_class_pima_read.c')
| -rw-r--r-- | common/usbx_host_classes/src/ux_host_class_pima_read.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/common/usbx_host_classes/src/ux_host_class_pima_read.c b/common/usbx_host_classes/src/ux_host_class_pima_read.c index d775fcd..ee272a3 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_read.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_read.c @@ -30,12 +30,16 @@ #include "ux_host_stack.h" +#if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < UX_HOST_CLASS_PIMA_CONTAINER_SIZE +#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +82,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_read(UX_HOST_CLASS_PIMA *pima, UCHAR *data_pointer, @@ -117,7 +126,7 @@ ULONG payload_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -171,7 +180,7 @@ ULONG payload_length; /* Copying the necessary partial memory. */ _ux_utility_memory_copy(data_pointer, ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE, - transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); + transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); /* Use case of memcpy is verified. */ /* Adjust the data payload pointer. */ data_pointer += (transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); @@ -202,7 +211,7 @@ ULONG payload_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -257,7 +266,7 @@ ULONG payload_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) |
