Skip to content

Commit 68aee7d

Browse files
authored
Merge pull request #211 from eclipse-threadx/dev
Merge changes ahead of the v.6.4.3.202503 release.
2 parents cfdd55c + b043171 commit 68aee7d

20 files changed

+1336
-239
lines changed

common/core/inc/ux_api.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,9 @@ typedef signed char SCHAR;
348348
#define AZURE_RTOS_USBX
349349
#define USBX_MAJOR_VERSION 6
350350
#define USBX_MINOR_VERSION 4
351-
#define USBX_PATCH_VERSION 2
351+
#define USBX_PATCH_VERSION 3
352+
#define USBX_BUILD_VERSION 202503
353+
#define USBX_HOTFIX_VERSION ''
352354

353355
/* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */
354356

@@ -2747,9 +2749,9 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT
27472749
/* Define USBX Services. */
27482750

27492751
#if defined(UX_SYSTEM_ENABLE_ERROR_CHECKING)
2750-
#define ux_system_initialize _ux_system_initialize
2751-
#else
27522752
#define ux_system_initialize _uxe_system_initialize
2753+
#else
2754+
#define ux_system_initialize _ux_system_initialize
27532755
#endif
27542756

27552757
#define ux_system_uninitialize _ux_system_uninitialize

common/core/inc/ux_utility.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ extern ULONG _ux_utility_time_get(VOID);
172172
#endif
173173

174174
#ifndef _ux_utility_time_elapsed
175-
#define _ux_utility_time_elapsed(a,b) (((b)>=(a)) ? ((b)-(a)) : (0xFFFFFFFFul-(b)+(a)+1))
175+
#define _ux_utility_time_elapsed(a,b) (((b)>=(a)) ? ((b)-(a)) : (0xFFFFFFFFul-(a)+(b)+1))
176176
#else
177177
extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
178178
#endif

common/usbx_device_classes/src/ux_device_class_hid_deactivate.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ UX_SLAVE_CLASS *class_ptr;
8686
/* Terminate the transactions pending on the endpoints. */
8787
_ux_device_stack_transfer_all_request_abort(hid -> ux_device_class_hid_interrupt_endpoint, UX_TRANSFER_BUS_RESET);
8888

89+
#if defined(UX_DEVICE_CLASS_HID_INTERRUPT_OUT_SUPPORT)
90+
_ux_device_stack_transfer_all_request_abort(hid -> ux_device_class_hid_read_endpoint, UX_TRANSFER_BUS_RESET);
91+
#endif
92+
8993
/* If there is a deactivate function call it. */
9094
if (hid -> ux_slave_class_hid_instance_deactivate != UX_NULL)
9195
{

common/usbx_device_classes/src/ux_device_class_pima_interrupt_thread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ UCHAR *buffer;
169169
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_1, pima_event.ux_device_class_pima_event_parameter_1);
170170

171171
/* Put the value of parameter 2. */
172-
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_2, pima_event.ux_device_class_pima_event_parameter_3);
172+
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_2, pima_event.ux_device_class_pima_event_parameter_2);
173173

174174
/* Put the value of parameter 3. */
175-
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_2, pima_event.ux_device_class_pima_event_parameter_3);
175+
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_3, pima_event.ux_device_class_pima_event_parameter_3);
176176

177177
/* Send the request to the device controller. */
178178
status = _ux_device_stack_transfer_request(transfer_request_in, UX_DEVICE_CLASS_PIMA_AEI_MAX_LENGTH, UX_DEVICE_CLASS_PIMA_AEI_MAX_LENGTH);

common/usbx_device_classes/src/ux_device_class_pima_object_info_send.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,18 @@ ULONG object_handle;
223223
/* Send the object to the application. */
224224
status = pima -> ux_device_class_pima_object_info_send(pima, object, storage_id, parent_object_handle, &object_handle);
225225

226-
/* Now we return a response with success. */
227-
status = (status == UX_SUCCESS) ? UX_DEVICE_CLASS_PIMA_RC_OK : status;
228-
_ux_device_class_pima_response_send(pima, status, 3, pima -> ux_device_class_pima_storage_id,
226+
if (status != UX_SUCCESS)
227+
{
228+
/* Now we return a response with error. */
229+
_ux_device_class_pima_response_send(pima, status, 3, pima -> ux_device_class_pima_storage_id,
229230
object -> ux_device_class_pima_object_parent_object, object_handle);
231+
}
232+
else
233+
{
234+
/* Now we return a response with success. */
235+
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 3, pima -> ux_device_class_pima_storage_id,
236+
object -> ux_device_class_pima_object_parent_object, object_handle);
237+
}
230238

231239
/* Store the object handle. It will be used for the OBJECT_SEND command. */
232240
pima -> ux_device_class_pima_current_object_handle = object_handle;

common/usbx_device_classes/src/ux_device_class_pima_object_references_set.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,16 @@ ULONG object_references_length;
128128

129129
/* Send the object references to the application. */
130130
status = pima -> ux_device_class_pima_object_references_set(pima, object_handle, object_references, object_references_length);
131-
132-
/* Now we return a response with success. */
133-
status = (status == UX_SUCCESS) ? UX_DEVICE_CLASS_PIMA_RC_OK : status;
134-
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);
131+
132+
/* Check error code from application. */
133+
if (status == UX_SUCCESS)
134+
135+
/* Now we return a response with success. */
136+
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
137+
else
138+
139+
/* We return an error. The code is passed by the application. */
140+
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);
135141

136142
}
137143
else

common/usbx_device_classes/src/ux_device_class_storage_initialize.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/***************************************************************************
2-
* Copyright (c) 2024 Microsoft Corporation
3-
*
2+
* Copyright (c) 2024 Microsoft Corporation
3+
*
44
* This program and the accompanying materials are made available under the
55
* terms of the MIT License which is available at
66
* https://opensource.org/licenses/MIT.
7-
*
7+
*
88
* SPDX-License-Identifier: MIT
99
**************************************************************************/
1010

@@ -30,7 +30,7 @@
3030

3131
/* Define the Slave Storage Class Inquiry data : DO NOT CHANGE THE LENGTH OF THESE ITEMS */
3232

33-
UCHAR _ux_system_slave_class_storage_vendor_id[] = "AzureRTO";
33+
UCHAR _ux_system_slave_class_storage_vendor_id[] = "Eclipse ";
3434
UCHAR _ux_system_slave_class_storage_product_id[] = "USBX storage dev";
3535
UCHAR _ux_system_slave_class_storage_product_rev[] = "2000";
3636
UCHAR _ux_system_slave_class_storage_product_serial[] = "12345678901234567890";
@@ -290,8 +290,17 @@ UINT i;
290290
storage_parameter = command -> ux_slave_class_command_parameter;
291291

292292
/* Sanity checks. */
293-
if (storage_parameter -> ux_slave_class_storage_parameter_number_lun > UX_MAX_SLAVE_LUN)
293+
if ((storage_parameter -> ux_slave_class_storage_parameter_number_lun > UX_MAX_SLAVE_LUN) ||
294+
((storage_parameter -> ux_slave_class_storage_parameter_vendor_id != UX_NULL) &&
295+
( _ux_utility_string_length_get(storage_parameter -> ux_slave_class_storage_parameter_vendor_id) != 8)) ||
296+
((storage_parameter -> ux_slave_class_storage_parameter_product_id != UX_NULL) &&
297+
( _ux_utility_string_length_get(storage_parameter -> ux_slave_class_storage_parameter_product_id) != 16)) ||
298+
((storage_parameter -> ux_slave_class_storage_parameter_product_rev != UX_NULL) &&
299+
( _ux_utility_string_length_get(storage_parameter -> ux_slave_class_storage_parameter_product_rev) != 4)) ||
300+
((storage_parameter -> ux_slave_class_storage_parameter_product_serial != UX_NULL) &&
301+
( _ux_utility_string_length_get(storage_parameter -> ux_slave_class_storage_parameter_product_serial) != 20)))
294302
return(UX_INVALID_PARAMETER);
303+
295304
for (i = 0; i < storage_parameter -> ux_slave_class_storage_parameter_number_lun; i ++)
296305
{
297306
if ((storage_parameter -> ux_slave_class_storage_parameter_lun[i].

0 commit comments

Comments
 (0)