summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Desbiens <[email protected]>2026-03-03 17:37:32 +0100
committerGitHub <[email protected]>2026-03-03 17:37:32 +0100
commit3456fbc11058b3367502a40d4eadf0aecaab55c9 (patch)
treefa48073672a7b872ee0b719c800587d055430b0e
parent74288e2ca4bd16b3b56de4020ff5675d0b8af7b0 (diff)
parent02f431b0bdf5f376e2fd60a7ac0481528f941215 (diff)
Merge pull request #228 from ayedm1/refer_to_ux_internal_definesv6.5.0.202601_pre
Improved code to leverage the ux internal macros instead of using direct tx struct fields
-rw-r--r--common/core/inc/ux_utility.h43
-rw-r--r--common/core/src/ux_host_stack_initialize.c100
-rw-r--r--common/core/src/ux_utility_delay_ms.c76
-rw-r--r--common/usbx_device_classes/src/ux_device_class_audio_change.c9
-rw-r--r--common/usbx_device_classes/src/ux_device_class_cdc_acm_initialize.c97
-rw-r--r--common/usbx_device_classes/src/ux_device_class_dfu_initialize.c8
-rw-r--r--common/usbx_device_classes/src/ux_device_class_rndis_initialize.c122
-rw-r--r--common/usbx_device_classes/src/ux_device_class_video_initialize.c10
-rw-r--r--common/usbx_host_classes/src/ux_host_class_asix_activate.c119
-rw-r--r--common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c78
-rw-r--r--common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c94
-rw-r--r--common/usbx_host_classes/src/ux_host_class_hid_keyboard_activate.c92
-rw-r--r--common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c15
-rw-r--r--ports/arm9/gnu/inc/ux_port.h3
-rw-r--r--ports/arm9/iar/inc/ux_port.h43
-rw-r--r--ports/cortex_a15/gnu/inc/ux_port.h3
-rw-r--r--ports/cortex_a5/gnu/inc/ux_port.h43
-rw-r--r--ports/cortex_a5/iar/inc/ux_port.h43
-rw-r--r--ports/cortex_a5x/ac6/inc/ux_port.h3
-rw-r--r--ports/cortex_a7/gnu/inc/ux_port.h43
-rw-r--r--ports/cortex_a7/iar/inc/ux_port.h43
-rw-r--r--ports/cortex_a8/gnu/inc/ux_port.h43
-rw-r--r--ports/cortex_a8/iar/inc/ux_port.h3
-rw-r--r--ports/cortex_a9/gnu/inc/ux_port.h3
-rw-r--r--ports/cortex_a9/iar/inc/ux_port.h3
-rw-r--r--ports/cortex_m0/gnu/inc/ux_port.h3
-rw-r--r--ports/cortex_m0/iar/inc/ux_port.h3
-rw-r--r--ports/cortex_m3/gnu/inc/ux_port.h3
-rw-r--r--ports/cortex_m33/gnu/inc/ux_port.h3
-rw-r--r--ports/cortex_m33/iar/inc/ux_port.h3
-rw-r--r--ports/cortex_m4/gnu/inc/ux_port.h43
-rw-r--r--ports/cortex_m4/iar/inc/ux_port.h43
-rw-r--r--ports/cortex_m7/gnu/inc/ux_port.h43
-rw-r--r--ports/cortex_m7/iar/inc/ux_port.h43
-rw-r--r--ports/cortex_r4/gnu/inc/ux_port.h3
-rw-r--r--ports/cortex_r4/iar/inc/ux_port.h3
-rw-r--r--ports/cortex_r5/gnu/inc/ux_port.h4
-rw-r--r--ports/cortex_r5/iar/inc/ux_port.h2
-rw-r--r--ports/generic/inc/ux_port.h4
-rw-r--r--ports/linux/gnu/inc/ux_port.h3
40 files changed, 697 insertions, 648 deletions
diff --git a/common/core/inc/ux_utility.h b/common/core/inc/ux_utility.h
index 555bf63..291ab14 100644
--- a/common/core/inc/ux_utility.h
+++ b/common/core/inc/ux_utility.h
@@ -180,26 +180,31 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#if !defined(UX_STANDALONE)
#define _ux_system_semaphore_create _ux_utility_semaphore_create
#define _ux_system_semaphore_create_norc _ux_utility_semaphore_create
-#define _ux_system_semaphore_created(sem) ((sem)->tx_semaphore_id != UX_EMPTY)
#define _ux_system_semaphore_get _ux_utility_semaphore_get
#define _ux_system_semaphore_get_norc _ux_utility_semaphore_get
-#define _ux_system_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
#define _ux_system_semaphore_delete _ux_utility_semaphore_delete
#define _ux_system_semaphore_put _ux_utility_semaphore_put
#define _ux_system_thread_create _ux_utility_thread_create
#define _ux_system_thread_create_norc _ux_utility_thread_create
-#define _ux_system_thread_created(t) ((t)->tx_thread_id != UX_EMPTY)
#define _ux_system_thread_delete _ux_utility_thread_delete
#define _ux_system_mutex_create _ux_utility_mutex_create
#define _ux_system_mutex_delete _ux_utility_mutex_delete
#define _ux_system_mutex_off _ux_utility_mutex_off
#define _ux_system_mutex_on _ux_utility_mutex_on
#define _ux_system_event_flags_create _ux_utility_event_flags_create
-#define _ux_system_event_flags_created(e) ((e)->tx_event_flags_group_id != UX_EMPTY)
#define _ux_system_event_flags_delete _ux_utility_event_flags_delete
#define _ux_system_event_flags_get _ux_utility_event_flags_get
#define _ux_system_event_flags_set _ux_utility_event_flags_set
#define _ux_system_event_flags_set_rc _ux_utility_event_flags_set
+#ifdef TX_API_H
+#define _ux_system_thread_entry(t) ((t)->tx_thread_entry)
+#define _ux_system_thread_created(t) ((t)->tx_thread_id != UX_EMPTY)
+#define _ux_system_semaphore_created(sem) ((sem)->tx_semaphore_id != UX_EMPTY)
+#define _ux_system_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
+#define _ux_system_event_flags_created(e) ((e)->tx_event_flags_group_id != UX_EMPTY)
+#define _ux_system_mutex_created(m) ((m)->tx_mutex_id != UX_EMPTY)
+#define _ux_system_mutex_suspended_count(m) ((m)->tx_mutex_suspended_count)
+#endif /* TX_API_H */
#else
#define _ux_system_semaphore_create(sem,name,cnt) (UX_SUCCESS)
#define _ux_system_semaphore_create_norc(sem,name,cnt) do{}while(0)
@@ -223,18 +228,16 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#define _ux_system_event_flags_get(g,req,gopt,actual,wopt) (*actual = 0)
#define _ux_system_event_flags_set(g,flags,option) do{(void)flags;}while(0)
#define _ux_system_event_flags_set_rc(g,flags,option) (UX_SUCCESS)
+#define _ux_system_mutex_created(m) (UX_FALSE)
#endif
#if !defined(UX_DEVICE_STANDALONE)
#define _ux_device_thread_create _ux_utility_thread_create
#define _ux_device_thread_delete _ux_utility_thread_delete
-#define _ux_device_thread_entry(t) ((t)->tx_thread_entry)
#define _ux_device_thread_suspend _ux_utility_thread_suspend
#define _ux_device_thread_resume _ux_utility_thread_resume
#define _ux_device_thread_relinquish _ux_utility_thread_relinquish
#define _ux_device_semaphore_create _ux_utility_semaphore_create
-#define _ux_device_semaphore_created(sem) ((sem)->tx_semaphore_id != 0)
-#define _ux_device_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
#define _ux_device_semaphore_delete _ux_utility_semaphore_delete
#define _ux_device_semaphore_get _ux_utility_semaphore_get
#define _ux_device_semaphore_put _ux_utility_semaphore_put
@@ -246,6 +249,15 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#define _ux_device_event_flags_delete _ux_utility_event_flags_delete
#define _ux_device_event_flags_get _ux_utility_event_flags_get
#define _ux_device_event_flags_set _ux_utility_event_flags_set
+#ifdef TX_API_H
+#define _ux_device_thread_entry(t) ((t)->tx_thread_entry)
+#define _ux_device_thread_created(t) ((t)->tx_thread_id != UX_EMPTY)
+#define _ux_device_semaphore_created(sem) ((sem)->tx_semaphore_id != UX_EMPTY)
+#define _ux_device_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
+#define _ux_device_event_flags_created(e) ((e)->tx_event_flags_group_id != UX_EMPTY)
+#define _ux_device_mutex_created(m) ((m)->tx_mutex_id != UX_EMPTY)
+#define _ux_device_mutex_suspended_count(m) ((m)->tx_mutex_suspended_count)
+#endif /* TX_API_H */
#else
#define _ux_device_thread_create(t,name,entry,entry_param,stack,stack_size,priority,preempt_threshold,time_slice,auto_start) (UX_SUCCESS)
#define _ux_device_thread_delete(t) do{}while(0)
@@ -267,20 +279,18 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#define _ux_device_event_flags_delete(g) do{}while(0)
#define _ux_device_event_flags_get(g,req,gopt,actual,wopt) do{}while(0)
#define _ux_device_event_flags_set(g,flags,option) do{}while(0)
+#define _ux_device_event_flags_created(e) (UX_FALSE)
+#define _ux_device_mutex_created(m) (UX_FALSE)
#endif
#if !defined(UX_HOST_STANDALONE)
#define _ux_host_thread_create _ux_utility_thread_create
-#define _ux_host_thread_created(thr) ((thr)->tx_thread_id != 0)
#define _ux_host_thread_delete _ux_utility_thread_delete
-#define _ux_host_thread_entry(thr) ((thr)->tx_thread_entry)
#define _ux_host_thread_resume _ux_utility_thread_resume
#define _ux_host_thread_sleep _ux_utility_thread_sleep
#define _ux_host_thread_schedule_other _ux_utility_thread_schedule_other
#define _ux_host_semaphore_create _ux_utility_semaphore_create
-#define _ux_host_semaphore_created(sem) ((sem)->tx_semaphore_id != 0)
-#define _ux_host_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
#define _ux_host_semaphore_delete _ux_utility_semaphore_delete
#define _ux_host_semaphore_get _ux_utility_semaphore_get
#define _ux_host_semaphore_get_norc _ux_utility_semaphore_get
@@ -296,6 +306,15 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#define _ux_host_event_flags_set _ux_utility_event_flags_set
#define _ux_host_timer_create _ux_utility_timer_create
#define _ux_host_timer_delete _ux_utility_timer_delete
+#ifdef TX_API_H
+#define _ux_host_thread_entry(t) ((t)->tx_thread_entry)
+#define _ux_host_thread_created(t) ((t)->tx_thread_id != UX_EMPTY)
+#define _ux_host_semaphore_created(sem) ((sem)->tx_semaphore_id != UX_EMPTY)
+#define _ux_host_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
+#define _ux_host_event_flags_created(e) ((e)->tx_event_flags_group_id != UX_EMPTY)
+#define _ux_host_mutex_created(m) ((m)->tx_mutex_id != UX_EMPTY)
+#define _ux_host_mutex_suspended_count(m) ((m)->tx_mutex_suspended_count)
+#endif /* TX_API_H */
#else
#define _ux_host_thread_create(t,name,entry,entry_param,stack,stack_size,priority,preempt_threshold,time_slice,auto_start) (UX_SUCCESS)
#define _ux_host_thread_created(t) (UX_FALSE)
@@ -322,6 +341,8 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#define _ux_host_event_flags_set(g,flags,option) do{}while(0)
#define _ux_host_timer_create(t,name,func,arg,tick0,tick1,flag) (UX_SUCCESS)
#define _ux_host_timer_delete(t) do{}while(0)
+#define _ux_host_event_flags_created(e) (UX_FALSE)
+#define _ux_host_mutex_created(m) (UX_FALSE)
#endif
diff --git a/common/core/src/ux_host_stack_initialize.c b/common/core/src/ux_host_stack_initialize.c
index dba8822..6c4cac6 100644
--- a/common/core/src/ux_host_stack_initialize.c
+++ b/common/core/src/ux_host_stack_initialize.c
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -41,7 +41,7 @@ UX_SYSTEM_HOST *_ux_system_host;
/* Define table of periodic tree entries, properly indexed. */
-UINT _ux_system_host_hcd_periodic_tree_entries[32] = {
+UINT _ux_system_host_hcd_periodic_tree_entries[32] = {
0x00, 0x10, 0x08, 0x18, 0x04, 0x14, 0x0c, 0x1c,
0x02, 0x12, 0x0a, 0x1a, 0x06, 0x16, 0x0e, 0x1e,
0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d,
@@ -81,47 +81,47 @@ UCHAR _ux_system_host_hcd_musb_name[] = "ux_
UCHAR _ux_system_host_hcd_atm7_name[] = "ux_hcd_atm7";
UCHAR _ux_system_host_hcd_simulator_name[] = "ux_hcd_simulator";
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_initialize PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes all the host code for USBX to work on a */
-/* specific platform. */
-/* */
-/* INPUT */
-/* */
-/* (ux_system_host_change_function) Function pointer to the */
-/* callback function for a */
-/* device change */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate host memory */
-/* _ux_utility_semaphore_create Create host semaphore */
-/* _ux_utility_mutex_create Create host mutex */
-/* _ux_utility_thread_create Create host thread */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This function initializes all the host code for USBX to work on a */
+/* specific platform. */
+/* */
+/* INPUT */
+/* */
+/* (ux_system_host_change_function) Function pointer to the */
+/* callback function for a */
+/* device change */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_allocate Allocate host memory */
+/* _ux_utility_semaphore_create Create host semaphore */
+/* _ux_utility_mutex_create Create host mutex */
+/* _ux_utility_thread_create Create host thread */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* optimized based on compile */
@@ -156,7 +156,7 @@ UX_DEVICE *device;
UX_SYSTEM_HOST_MAX_CLASS_SET(UX_MAX_CLASS_DRIVER);
UX_SYSTEM_HOST_MAX_HCD_SET(UX_MAX_HCD);
UX_SYSTEM_HOST_MAX_DEVICES_SET(UX_MAX_DEVICES);
-
+
/* Set the change device function address. */
_ux_system_host -> ux_system_host_change_function = ux_system_host_change_function;
@@ -274,7 +274,7 @@ UX_DEVICE *device;
0, _ux_system_host -> ux_system_host_enum_thread_stack,
UX_HOST_ENUM_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_ENUM,
UX_THREAD_PRIORITY_ENUM, UX_NO_TIME_SLICE, UX_AUTO_START);
-
+
/* Check the completion status. */
if(status != UX_SUCCESS)
status = UX_THREAD_ERROR;
@@ -305,7 +305,7 @@ UX_DEVICE *device;
if (_ux_system_host -> ux_system_host_hnp_polling_thread_stack == UX_NULL)
status = UX_MEMORY_INSUFFICIENT;
}
-
+
/* Create the HNP polling thread of USBX. */
if (status == UX_SUCCESS)
{
@@ -333,7 +333,7 @@ UX_DEVICE *device;
_ux_utility_memory_free(_ux_system_host -> ux_system_host_hnp_polling_thread_stack);
/* Delete _ux_system_host -> ux_system_host_hcd_thread. */
- if (_ux_system_host -> ux_system_host_hcd_thread.tx_thread_id != 0)
+ if (_ux_host_thread_created(&_ux_system_host -> ux_system_host_hcd_thread))
_ux_utility_thread_delete(&_ux_system_host -> ux_system_host_hcd_thread);
#else
@@ -349,15 +349,15 @@ UX_DEVICE *device;
#if !defined(UX_HOST_STANDALONE)
/* Delete _ux_system_host -> ux_system_host_enum_thread. */
- if (_ux_system_host -> ux_system_host_enum_thread.tx_thread_id != 0)
+ if (_ux_system_thread_created(&_ux_system_host -> ux_system_host_enum_thread))
_ux_utility_thread_delete(&_ux_system_host -> ux_system_host_enum_thread);
-
+
/* Delete _ux_system_host -> ux_system_host_hcd_semaphore. */
- if (_ux_system_host -> ux_system_host_hcd_semaphore.tx_semaphore_id != 0)
+ if (_ux_host_semaphore_created(&_ux_system_host -> ux_system_host_hcd_semaphore))
_ux_utility_semaphore_delete(&_ux_system_host -> ux_system_host_hcd_semaphore);
/* Delete _ux_system_host -> ux_system_host_enum_semaphore. */
- if (_ux_system_host -> ux_system_host_enum_semaphore.tx_semaphore_id != 0)
+ if (_ux_host_semaphore_created(&_ux_system_host -> ux_system_host_enum_semaphore))
_ux_utility_semaphore_delete(&_ux_system_host -> ux_system_host_enum_semaphore);
/* Free _ux_system_host -> ux_system_host_hcd_thread_stack. */
@@ -372,7 +372,7 @@ UX_DEVICE *device;
/* Free _ux_system_host -> ux_system_host_device_array. */
if (_ux_system_host -> ux_system_host_device_array)
_ux_utility_memory_free(_ux_system_host -> ux_system_host_device_array);
-
+
/* Free _ux_system_host -> ux_system_host_class_array. */
if (_ux_system_host -> ux_system_host_class_array)
_ux_utility_memory_free(_ux_system_host -> ux_system_host_class_array);
diff --git a/common/core/src/ux_utility_delay_ms.c b/common/core/src/ux_utility_delay_ms.c
index 706b450..d01c484 100644
--- a/common/core/src/ux_utility_delay_ms.c
+++ b/common/core/src/ux_utility_delay_ms.c
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -27,42 +27,42 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_delay_ms PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_delay_ms PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function causes the calling thread to sleep for the */
-/* specified number of milliseconds */
-/* */
-/* INPUT */
-/* */
-/* ms_wait Number of milliseconds to */
-/* wait for */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* tx_thread_sleep ThreadX sleep function */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This function causes the calling thread to sleep for the */
+/* specified number of milliseconds */
+/* */
+/* INPUT */
+/* */
+/* ms_wait Number of milliseconds to */
+/* wait for */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_thread_sleep RTOS sleep function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
@@ -91,12 +91,12 @@ ULONG ticks;
/* translate ms into ticks. */
ticks = (ULONG)(ms_wait * UX_PERIODIC_RATE) / 1000;
-
+
/* For safety add 1 to ticks. */
ticks++;
- /* Call ThreadX sleep function. */
- tx_thread_sleep(ticks);
+ /* Call RTOS sleep function. */
+ _ux_utility_thread_sleep(ticks);
#endif
/* Return completion status. */
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_change.c b/common/usbx_device_classes/src/ux_device_class_audio_change.c
index 6bb78a3..d39dbb4 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_change.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_change.c
@@ -1,10 +1,10 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -51,6 +51,7 @@
/* */
/* CALLS */
/* */
+/* _ux_utility_thread_resume Resume a suspended thread */
/* _ux_system_error_handler System error trap */
/* */
/* CALLED BY */
@@ -149,7 +150,7 @@ ULONG endpoint_dir;
UX_ENDPOINT_OUT: UX_ENDPOINT_IN;
#else
- endpoint_dir = (stream -> ux_device_class_audio_stream_thread.tx_thread_entry ==
+ endpoint_dir = (_ux_device_thread_entry(&stream -> ux_device_class_audio_stream_thread) ==
_ux_device_class_audio_read_thread_entry) ?
UX_ENDPOINT_OUT : UX_ENDPOINT_IN;
#endif
diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_initialize.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_initialize.c
index 20066a7..f9c35b2 100644
--- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_initialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_initialize.c
@@ -1,16 +1,16 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -31,43 +31,43 @@
#error UX_THREAD_STACK_SIZE too large
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_acm_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_acm_initialize PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes the USB CDC device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to cdc_acm command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate memory */
-/* _ux_utility_memory_free Free memory */
-/* _ux_utility_mutex_create Create mutex */
-/* _ux_device_mutex_delete Delete mutex */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This function initializes the USB CDC device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to cdc_acm command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_allocate Allocate memory */
+/* _ux_utility_memory_free Free memory */
+/* _ux_utility_mutex_create Create mutex */
+/* _ux_device_mutex_delete Delete mutex */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
@@ -95,7 +95,7 @@
/**************************************************************************/
UINT _ux_device_class_cdc_acm_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_CDC_ACM *cdc_acm;
UX_SLAVE_CLASS_CDC_ACM_PARAMETER *cdc_acm_parameter;
UX_SLAVE_CLASS *class_ptr;
@@ -132,10 +132,10 @@ UINT status;
UX_DEVICE_CLASS_CDC_ACM_ENDPOINT_BUFFER_SIZE);
if (cdc_acm -> ux_device_class_cdc_acm_endpoint_buffer == UX_NULL)
{
-
+
/* Free the resources. */
_ux_utility_memory_free(cdc_acm);
-
+
/* Return fatal error. */
return(UX_MEMORY_INSUFFICIENT);
}
@@ -155,10 +155,10 @@ UINT status;
_ux_utility_memory_free(cdc_acm -> ux_device_class_cdc_acm_endpoint_buffer);
#endif
_ux_utility_memory_free(cdc_acm);
-
+
/* Return fatal error. */
return(UX_MUTEX_ERROR);
- }
+ }
/* Out Mutex. */
status = _ux_utility_mutex_create(&cdc_acm -> ux_slave_class_cdc_acm_endpoint_out_mutex, "ux_slave_class_cdc_acm_out_mutex");
@@ -175,10 +175,10 @@ UINT status;
_ux_utility_memory_free(cdc_acm -> ux_device_class_cdc_acm_endpoint_buffer);
#endif
_ux_utility_memory_free(cdc_acm);
-
+
/* Return fatal error. */
return(UX_MUTEX_ERROR);
- }
+ }
#endif
@@ -198,7 +198,7 @@ UINT status;
/* We need to prepare the 2 threads for sending and receiving. */
/* Allocate some memory for the bulk out and in thread stack. */
- cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack =
+ cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE * 2);
/* Check for successful allocation. */
@@ -236,7 +236,7 @@ UINT status;
does not start until we have a instance of the class. */
status = _ux_utility_thread_create(
&cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread,
- "ux_slave_class_cdc_acm_bulkin_thread",
+ "ux_slave_class_cdc_acm_bulkin_thread",
_ux_device_class_cdc_acm_bulkin_thread,
(ULONG) (ALIGN_TYPE) cdc_acm,
(VOID *) cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread_stack,
@@ -264,7 +264,7 @@ UINT status;
does not start until we have a instance of the class. */
status = _ux_utility_thread_create(
&cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread,
- "ux_slave_class_cdc_acm_bulkout_thread",
+ "ux_slave_class_cdc_acm_bulkout_thread",
_ux_device_class_cdc_acm_bulkout_thread,
(ULONG) (ALIGN_TYPE) cdc_acm,
(VOID *) cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack,
@@ -288,9 +288,9 @@ UINT status;
{
/* Free resources and return error. */
- if (cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread.tx_thread_id)
+ if (_ux_device_thread_created(&cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread))
_ux_utility_thread_delete(&cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread);
- if (cdc_acm -> ux_slave_class_cdc_acm_event_flags_group.tx_event_flags_group_id)
+ if (_ux_device_event_flags_created(&cdc_acm -> ux_slave_class_cdc_acm_event_flags_group))
_ux_utility_event_flags_delete(&cdc_acm -> ux_slave_class_cdc_acm_event_flags_group);
if (cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack)
_ux_utility_memory_free(cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack);
@@ -309,4 +309,3 @@ UINT status;
/* Return completion status. */
return(UX_SUCCESS);
}
-
diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c b/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c
index ef72054..4d6105d 100644
--- a/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c
@@ -1,10 +1,10 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -243,7 +243,7 @@ ULONG descriptor_length;
/* The last resource, thread is not created or created error, no need to free. */
if (dfu -> ux_slave_class_dfu_thread_stack)
_ux_utility_memory_free(dfu -> ux_slave_class_dfu_thread_stack);
- if (dfu -> ux_slave_class_dfu_event_flags_group.tx_event_flags_group_id != 0)
+ if (_ux_device_event_flags_created(&dfu -> ux_slave_class_dfu_event_flags_group))
_ux_utility_event_flags_delete(&dfu -> ux_slave_class_dfu_event_flags_group);
#endif
diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c b/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c
index 5994ca7..4609483 100644
--- a/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c
@@ -1,16 +1,16 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -72,35 +72,35 @@ ULONG ux_device_class_rndis_oid_supported_list[UX_DEVICE_CLASS_RNDIS_OID_SUPPORT
0,
};
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_initialize PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes the USB RNDIS device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to rndis command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate memory */
+/* */
+/* This function initializes the USB RNDIS device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to rndis command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_allocate Allocate memory */
/* _ux_utility_memory_copy Copy memory */
/* _ux_utility_memory_free Free memory */
-/* _ux_utility_event_flags_create Create Flag group */
-/* _ux_utility_event_flags_delete Delete Flag group */
+/* _ux_utility_event_flags_create Create Flag group */
+/* _ux_utility_event_flags_delete Delete Flag group */
/* _ux_utility_mutex_create Create mutex */
/* _ux_device_mutex_delete Delete mutex */
/* _ux_device_semaphore_create Create semaphore */
@@ -109,15 +109,15 @@ ULONG ux_device_class_rndis_oid_supported_list[UX_DEVICE_CLASS_RNDIS_OID_SUPPORT
/* _ux_device_thread_delete Delete thread */
/* nx_packet_pool_create Create NetX packet pool */
/* nx_packet_pool_delete Delete NetX packet pool */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* verified memset and memcpy */
@@ -185,16 +185,16 @@ UINT status = UX_SUCCESS;
/* Store the start and stop signals if needed by the application. */
rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_instance_activate = rndis_parameter -> ux_slave_class_rndis_instance_activate;
rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_instance_deactivate = rndis_parameter -> ux_slave_class_rndis_instance_deactivate;
-
+
/* Save the Netx IP passed by the application. */
- rndis -> ux_slave_class_rndis_nx_ip = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip;
-
+ rndis -> ux_slave_class_rndis_nx_ip = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip;
+
/* Save the Netx IP address passed by the application. */
- rndis -> ux_slave_class_rndis_nx_ip_address = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip_address;
-
+ rndis -> ux_slave_class_rndis_nx_ip_address = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip_address;
+
/* Save the Netx IP address network mask passed by the application. */
- rndis -> ux_slave_class_rndis_nx_ip_network_mask = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip_network_mask;
-
+ rndis -> ux_slave_class_rndis_nx_ip_network_mask = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip_network_mask;
+
/* Copy the local node ID. */
_ux_utility_memory_copy(rndis -> ux_slave_class_rndis_local_node_id, rndis_parameter -> ux_slave_class_rndis_parameter_local_node_id,
UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH); /* Use case of memcpy is verified. */
@@ -230,9 +230,9 @@ UINT status = UX_SUCCESS;
/* Allocate some memory for the interrupt thread stack. */
if (status == UX_SUCCESS)
{
- rndis -> ux_slave_class_rndis_interrupt_thread_stack =
+ rndis -> ux_slave_class_rndis_interrupt_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
-
+
/* Check for successful allocation. */
if (rndis -> ux_slave_class_rndis_interrupt_thread_stack == UX_NULL)
@@ -245,12 +245,12 @@ UINT status = UX_SUCCESS;
does not start until we have a instance of the class. */
if (status == UX_SUCCESS)
{
- status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_interrupt_thread , "ux_slave_class_rndis_interrupt_thread",
+ status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_interrupt_thread , "ux_slave_class_rndis_interrupt_thread",
_ux_device_class_rndis_interrupt_thread,
(ULONG) (ALIGN_TYPE) class_ptr, (VOID *) rndis -> ux_slave_class_rndis_interrupt_thread_stack ,
UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS,
UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START);
-
+
/* Check the creation of this thread. */
if (status != UX_SUCCESS)
status = UX_THREAD_ERROR;
@@ -261,9 +261,9 @@ UINT status = UX_SUCCESS;
/* Allocate some memory for the bulk out thread stack. */
if (status == UX_SUCCESS)
{
- rndis -> ux_slave_class_rndis_bulkout_thread_stack =
+ rndis -> ux_slave_class_rndis_bulkout_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
-
+
/* Check for successful allocation. */
if (rndis -> ux_slave_class_rndis_bulkout_thread_stack == UX_NULL)
status = UX_MEMORY_INSUFFICIENT;
@@ -274,12 +274,12 @@ UINT status = UX_SUCCESS;
does not start until we have a instance of the class. */
if (status == UX_SUCCESS)
{
- status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_bulkout_thread , "ux_slave_class_rndis_bulkout_thread",
+ status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_bulkout_thread , "ux_slave_class_rndis_bulkout_thread",
_ux_device_class_rndis_bulkout_thread,
(ULONG) (ALIGN_TYPE) class_ptr, (VOID *) rndis -> ux_slave_class_rndis_bulkout_thread_stack ,
UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS,
UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START);
-
+
/* Check the creation of this thread. */
if (status != UX_SUCCESS)
status = UX_THREAD_ERROR;
@@ -290,9 +290,9 @@ UINT status = UX_SUCCESS;
/* Allocate some memory for the bulk in thread stack. */
if (status == UX_SUCCESS)
{
- rndis -> ux_slave_class_rndis_bulkin_thread_stack =
+ rndis -> ux_slave_class_rndis_bulkin_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
-
+
/* Check for successful allocation. */
if (rndis -> ux_slave_class_rndis_bulkin_thread_stack == UX_NULL)
status = UX_MEMORY_INSUFFICIENT;
@@ -303,7 +303,7 @@ UINT status = UX_SUCCESS;
does not start until we have a instance of the class. */
if (status == UX_SUCCESS)
{
- status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_bulkin_thread , "ux_slave_class_rndis_bulkin_thread",
+ status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_bulkin_thread , "ux_slave_class_rndis_bulkin_thread",
_ux_device_class_rndis_bulkin_thread,
(ULONG) (ALIGN_TYPE) class_ptr, (VOID *) rndis -> ux_slave_class_rndis_bulkin_thread_stack ,
UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS,
@@ -342,15 +342,15 @@ UINT status = UX_SUCCESS;
/* Failed! Free up resources. */
/* Delete semaphore for protecting the driver entry. */
- if (rndis -> ux_slave_class_rndis_semaphore.tx_semaphore_id != 0)
+ if (_ux_device_semaphore_created(&rndis -> ux_slave_class_rndis_semaphore))
_ux_device_semaphore_delete(&rndis -> ux_slave_class_rndis_semaphore);
/* Delete rndis -> ux_slave_class_rndis_event_flags_group. */
- if (rndis -> ux_slave_class_rndis_event_flags_group.tx_event_flags_group_id != 0)
+ if (_ux_device_event_flags_created(&rndis -> ux_slave_class_rndis_event_flags_group))
_ux_utility_event_flags_delete(&rndis -> ux_slave_class_rndis_event_flags_group);
/* Delete rndis -> ux_slave_class_rndis_bulkin_thread. */
- if (rndis -> ux_slave_class_rndis_bulkin_thread.tx_thread_id != 0)
+ if (_ux_device_thread_created(&rndis -> ux_slave_class_rndis_bulkin_thread))
_ux_device_thread_delete(&rndis -> ux_slave_class_rndis_bulkin_thread);
/* Free rndis -> ux_slave_class_rndis_bulkin_thread_stack. */
@@ -358,23 +358,23 @@ UINT status = UX_SUCCESS;
_ux_utility_memory_free(rndis -> ux_slave_class_rndis_bulkin_thread_stack);
/* Delete rndis -> ux_slave_class_rndis_bulkout_thread. */
- if (rndis -> ux_slave_class_rndis_bulkout_thread.tx_thread_id != 0)
+ if (_ux_device_thread_created(&rndis -> ux_slave_class_rndis_bulkout_thread))
_ux_device_thread_delete(&rndis -> ux_slave_class_rndis_bulkout_thread);
/* Free rndis -> ux_slave_class_rndis_bulkout_thread_stack. */
if (rndis -> ux_slave_class_rndis_bulkout_thread_stack)
_ux_utility_memory_free(rndis -> ux_slave_class_rndis_bulkout_thread_stack);
-
+
/* Delete rndis -> ux_slave_class_rndis_interrupt_thread. */
- if (rndis -> ux_slave_class_rndis_interrupt_thread.tx_thread_id != 0)
+ if (_ux_device_thread_created(&rndis -> ux_slave_class_rndis_interrupt_thread))
_ux_device_thread_delete(&rndis -> ux_slave_class_rndis_interrupt_thread);
-
+
/* Free rndis -> ux_slave_class_rndis_interrupt_thread_stack. */
if (rndis -> ux_slave_class_rndis_interrupt_thread_stack)
_ux_utility_memory_free(rndis -> ux_slave_class_rndis_interrupt_thread_stack);
/* Delete rndis -> ux_slave_class_rndis_mutex. */
- if (rndis -> ux_slave_class_rndis_mutex.tx_mutex_id != 0)
+ if (_ux_device_mutex_created(&rndis -> ux_slave_class_rndis_mutex))
_ux_device_mutex_delete(&rndis -> ux_slave_class_rndis_mutex);
#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1
diff --git a/common/usbx_device_classes/src/ux_device_class_video_initialize.c b/common/usbx_device_classes/src/ux_device_class_video_initialize.c
index cee4b2c..35dc15a 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_initialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_initialize.c
@@ -1,10 +1,10 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -250,7 +250,7 @@ ULONG i;
{
#if !defined(UX_DEVICE_STANDALONE)
- if (stream -> ux_device_class_video_stream_thread.tx_thread_id)
+ if (_ux_device_thread_created(&stream -> ux_device_class_video_stream_thread))
_ux_utility_thread_delete(&stream -> ux_device_class_video_stream_thread);
if (stream -> ux_device_class_video_stream_thread_stack)
_ux_utility_memory_free(stream -> ux_device_class_video_stream_thread_stack);
@@ -327,4 +327,4 @@ ULONG i;
/* Do initialize. */
return(_ux_device_class_video_initialize(command));
-} \ No newline at end of file
+}
diff --git a/common/usbx_host_classes/src/ux_host_class_asix_activate.c b/common/usbx_host_classes/src/ux_host_class_asix_activate.c
index 9e6f037..a124331 100644
--- a/common/usbx_host_classes/src/ux_host_class_asix_activate.c
+++ b/common/usbx_host_classes/src/ux_host_class_asix_activate.c
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -29,53 +29,53 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_activate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the asix instance, configure the device. */
-/* WARNING !!!! The NX_PHYSICAL_HEADER should be set to 20 in nx_api.h */
-/* */
-/* INPUT */
-/* */
-/* command Asix class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_asix_configure Configure asix class */
-/* _ux_host_class_asix_endpoints_get Get endpoints of asix */
+/* */
+/* This function creates the asix instance, configure the device. */
+/* WARNING !!!! The NX_PHYSICAL_HEADER should be set to 20 in nx_api.h */
+/* */
+/* INPUT */
+/* */
+/* command Asix class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_asix_configure Configure asix class */
+/* _ux_host_class_asix_endpoints_get Get endpoints of asix */
/* _ux_host_class_asix_setup Set up asix */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
/* _ux_host_stack_transfer_request Transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Free memory block */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Free memory block */
/* _ux_host_semaphore_create Create semaphore */
/* _ux_host_semaphore_delete Delete semaphore */
/* _ux_utility_thread_create Create thread */
/* _ux_utility_thread_delete Delete thread */
/* nx_packet_pool_create Create NetX packet pool */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_asix_entry Entry of asix class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_asix_entry Entry of asix class */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* used UX prefix to refer to */
@@ -113,7 +113,7 @@ ULONG physical_address_msw;
ULONG physical_address_lsw;
- /* We need to make sure that the value of the NX_PHYSICAL_HEADER is at least 20.
+ /* We need to make sure that the value of the NX_PHYSICAL_HEADER is at least 20.
This should be changed in the nx_user.h file */
@@ -132,16 +132,16 @@ ULONG physical_address_lsw;
asix -> ux_host_class_asix_device = device;
/* Store the instance in the device container, this is for the USBX stack
- when it needs to invoke the class for deactivation. */
+ when it needs to invoke the class for deactivation. */
device -> ux_device_class_instance = (VOID *) asix;
/* Create this class instance. */
_ux_host_stack_class_instance_create(asix -> ux_host_class_asix_class, (VOID *) asix);
/* Configure the asix class. */
- status = _ux_host_class_asix_configure(asix);
+ status = _ux_host_class_asix_configure(asix);
- /* Get the asix endpoint(s). We need to search for Bulk Out and Bulk In endpoints
+ /* Get the asix endpoint(s). We need to search for Bulk Out and Bulk In endpoints
and the interrupt endpoint. */
if (status == UX_SUCCESS)
status = _ux_host_class_asix_endpoints_get(asix);
@@ -165,7 +165,7 @@ ULONG physical_address_lsw;
/* Allocate a Thread stack. */
if (status == UX_SUCCESS)
{
- asix -> ux_host_class_asix_thread_stack =
+ asix -> ux_host_class_asix_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
/* Check the completion status. */
@@ -178,13 +178,13 @@ ULONG physical_address_lsw;
{
status = _ux_utility_thread_create(&asix -> ux_host_class_asix_thread,
"ux_asix_thread", _ux_host_class_asix_thread,
- (ULONG) asix,
+ (ULONG) asix,
asix -> ux_host_class_asix_thread_stack,
- UX_THREAD_STACK_SIZE,
+ UX_THREAD_STACK_SIZE,
UX_THREAD_PRIORITY_CLASS,
UX_THREAD_PRIORITY_CLASS,
- TX_NO_TIME_SLICE, UX_AUTO_START);
-
+ UX_NO_TIME_SLICE, UX_AUTO_START);
+
/* Check the completion status. */
if (status != UX_SUCCESS)
status = UX_THREAD_ERROR;
@@ -202,7 +202,7 @@ ULONG physical_address_lsw;
/* The ethernet link is down by default. */
asix -> ux_host_class_asix_link_state = UX_HOST_CLASS_ASIX_LINK_STATE_DOWN;
-
+
/* Start the interrupt pipe now. */
transfer_request = &asix -> ux_host_class_asix_interrupt_endpoint -> ux_endpoint_transfer_request;
status = _ux_host_stack_transfer_request(transfer_request);
@@ -222,12 +222,12 @@ ULONG physical_address_lsw;
/* Setup the physical address of this IP instance. */
physical_address_msw = (ULONG)((asix -> ux_host_class_asix_node_id[0] << 8) | (asix -> ux_host_class_asix_node_id[1]));
- physical_address_lsw = (ULONG)((asix -> ux_host_class_asix_node_id[2] << 24) | (asix -> ux_host_class_asix_node_id[3] << 16) |
+ physical_address_lsw = (ULONG)((asix -> ux_host_class_asix_node_id[2] << 24) | (asix -> ux_host_class_asix_node_id[3] << 16) |
(asix -> ux_host_class_asix_node_id[4] << 8) | (asix -> ux_host_class_asix_node_id[5]));
-
+
/* Register this interface to the NetX USB interface broker. */
- status = _ux_network_driver_activate((VOID *) asix, _ux_host_class_asix_write,
- &asix -> ux_host_class_asix_network_handle,
+ status = _ux_network_driver_activate((VOID *) asix, _ux_host_class_asix_write,
+ &asix -> ux_host_class_asix_network_handle,
physical_address_msw,
physical_address_lsw);
}
@@ -238,12 +238,12 @@ ULONG physical_address_lsw;
/* Mark the asix instance as live now. */
asix -> ux_host_class_asix_state = UX_HOST_CLASS_INSTANCE_LIVE;
-
+
/* If all is fine and the device is mounted, we need to inform the application
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_INSERTION, asix -> ux_host_class_asix_class, (VOID *) asix);
}
@@ -255,7 +255,7 @@ ULONG physical_address_lsw;
UX_TRACE_OBJECT_REGISTER(UX_TRACE_HOST_OBJECT_TYPE_INTERFACE, asix, 0, 0, 0)
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
/* There was a problem, so free the resources. */
@@ -265,7 +265,7 @@ ULONG physical_address_lsw;
_ux_utility_memory_free(asix -> ux_host_class_asix_receive_buffer);
/* Free asix -> ux_host_class_asix_thread. */
- if (asix -> ux_host_class_asix_thread.tx_thread_id)
+ if (_ux_host_thread_created(&asix -> ux_host_class_asix_thread))
_ux_utility_thread_delete(&asix -> ux_host_class_asix_thread);
/* Free asix -> ux_host_class_asix_thread_stack. */
@@ -273,11 +273,11 @@ ULONG physical_address_lsw;
_ux_utility_memory_free(asix -> ux_host_class_asix_thread_stack);
/* Free asix -> ux_host_class_asix_interrupt_notification_semaphore. */
- if (asix -> ux_host_class_asix_interrupt_notification_semaphore.tx_semaphore_id != 0)
+ if (_ux_host_semaphore_created(&asix -> ux_host_class_asix_interrupt_notification_semaphore))
_ux_host_semaphore_delete(&asix -> ux_host_class_asix_interrupt_notification_semaphore);
/* Free asix -> ux_host_class_asix_semaphore. */
- if (asix -> ux_host_class_asix_semaphore.tx_semaphore_id != 0)
+ if (_ux_host_semaphore_created(&asix -> ux_host_class_asix_semaphore))
_ux_host_semaphore_delete(&asix -> ux_host_class_asix_semaphore);
/* Destroy class instance. */
@@ -293,4 +293,3 @@ ULONG physical_address_lsw;
return(status);
#endif
}
-
diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c
index 4815a09..9153592 100644
--- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c
+++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** ACM CDC Class */
/** */
@@ -29,44 +29,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_acm_reception_stop PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_acm_reception_stop PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function stops background reception previously started by */
+/* */
+/* This function stops background reception previously started by */
/* ux_host_class_cdc_acm_reception_start. */
/* */
-/* INPUT */
-/* */
-/* cdc_acm Pointer to cdc_acm class */
+/* INPUT */
+/* */
+/* cdc_acm Pointer to cdc_acm class */
/* cdc_acm_reception Pointer to reception struct */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_endpoint_transfer_abort */
/* Abort transfer */
/* _ux_host_semaphore_get Get semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
@@ -75,7 +75,7 @@
/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
-UINT _ux_host_class_cdc_acm_reception_stop(UX_HOST_CLASS_CDC_ACM *cdc_acm,
+UINT _ux_host_class_cdc_acm_reception_stop(UX_HOST_CLASS_CDC_ACM *cdc_acm,
UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception)
{
@@ -86,7 +86,7 @@ UX_TRANSFER *transfer_request;
/* Ensure the instance is valid. */
if (cdc_acm -> ux_host_class_cdc_acm_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -100,7 +100,7 @@ UX_TRANSFER *transfer_request;
/* As further protection, we must ensure this instance of the interface is the data interface and not
the control interface ! */
if (cdc_acm -> ux_host_class_cdc_acm_interface -> ux_interface_descriptor.bInterfaceClass != UX_HOST_CLASS_CDC_DATA_CLASS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -110,11 +110,11 @@ UX_TRANSFER *transfer_request;
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
}
-
+
/* Check if we do have transfers for this application. If none, nothing to do. */
if (cdc_acm_reception -> ux_host_class_cdc_acm_reception_state == UX_HOST_CLASS_CDC_ACM_RECEPTION_STATE_STOPPED)
return(UX_SUCCESS);
-
+
/* We need to abort transactions on the bulk In pipe. */
_ux_host_stack_endpoint_transfer_abort(cdc_acm -> ux_host_class_cdc_acm_bulk_in_endpoint);
@@ -129,9 +129,9 @@ UX_TRANSFER *transfer_request;
#if !defined(UX_HOST_STANDALONE)
- /* Clear semaphore counts that were (incorrectly) increased during each transfer
+ /* Clear semaphore counts that were (incorrectly) increased during each transfer
completion. */
- while (transfer_request -> ux_transfer_request_semaphore.tx_semaphore_count)
+ while (_ux_host_semaphore_waiting(&(transfer_request -> ux_transfer_request_semaphore)))
_ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, 0);
#endif
@@ -178,7 +178,7 @@ UX_TRANSFER *transfer_request;
/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
/* */
/**************************************************************************/
-UINT _uxe_host_class_cdc_acm_reception_stop(UX_HOST_CLASS_CDC_ACM *cdc_acm,
+UINT _uxe_host_class_cdc_acm_reception_stop(UX_HOST_CLASS_CDC_ACM *cdc_acm,
UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c
index a50c7c7..7205d13 100644
--- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c
+++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC-ECM Class */
/** */
@@ -29,43 +29,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_ecm_transmission_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_ecm_transmission_callback PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the callback from the USBX transfer functions, */
-/* it is called when a full or partial transfer has been done for a */
+/* */
+/* This function is the callback from the USBX transfer functions, */
+/* it is called when a full or partial transfer has been done for a */
/* bulk out transfer. */
/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
/* nx_packet_transmit_release Release NetX packet */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
@@ -97,7 +97,7 @@ UCHAR *packet_header;
#ifdef UX_HOST_CLASS_CDC_ECM_PACKET_CHAIN_SUPPORT
ULONG copied;
#endif
-
+
/* Get the data and control class instances for this transfer request. */
cdc_ecm = (UX_HOST_CLASS_CDC_ECM *) transfer_request -> ux_transfer_request_class_instance;
@@ -105,23 +105,23 @@ ULONG copied;
if (cdc_ecm -> ux_host_class_cdc_ecm_link_state != UX_HOST_CLASS_CDC_ECM_LINK_STATE_UP ||
cdc_ecm -> ux_host_class_cdc_ecm_state == UX_HOST_CLASS_INSTANCE_SHUTDOWN)
- /* The CDC-ECM thread or deactivation routine is in the process of freeing
+ /* The CDC-ECM thread or deactivation routine is in the process of freeing
the queue. Just return so we are not simultaneously accessing it. */
return;
/* Get the packet associated with this transfer. */
current_packet = cdc_ecm -> ux_host_class_cdc_ecm_xmit_queue_head;
-
+
/* Do a sanity check on the packet. */
if (current_packet == UX_NULL)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FATAL_ERROR);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_INTERFACE_HANDLE_UNKNOWN, cdc_ecm, 0, 0, UX_FATAL_ERROR, 0, 0)
-
+
/* Something went terribly wrong. Do not proceed. */
return;
}
@@ -150,7 +150,7 @@ ULONG copied;
/* Set the next packet (or a NULL value) as the head of the xmit queue. */
cdc_ecm -> ux_host_class_cdc_ecm_xmit_queue_head = next_packet;
-
+
/* If there is nothing else or if the link is down no need to rearm a packet. */
if (next_packet != UX_NULL)
{
@@ -171,17 +171,17 @@ ULONG copied;
/* Load the address of the current packet header at the physical header. */
packet_header = next_packet -> nx_packet_prepend_ptr;
}
-
+
/* Prepare the values for this new transmission. */
transfer_request -> ux_transfer_request_data_pointer = packet_header;
transfer_request -> ux_transfer_request_requested_length = next_packet -> nx_packet_length;
-
+
/* Store the packet that owns this transaction. */
transfer_request -> ux_transfer_request_user_specific = next_packet;
/* If error log is enabled, insert this message into the log buffer. */
- UX_DEBUG_LOG("_ux_host_class_cdc_ecm_transmission_callback", "Sending packet", next_packet, next_packet, _ux_system -> ux_system_mutex.tx_mutex_suspended_count)
-
+ UX_DEBUG_LOG("_ux_host_class_cdc_ecm_transmission_callback", "Sending packet", next_packet, next_packet, _ux_system_mutex_suspended_count(&_ux_system -> ux_system_mutex))
+
/* If there is an error, the system will hang up. Not much we can do to
fix this. */
_ux_host_stack_transfer_request(transfer_request);
@@ -189,13 +189,13 @@ ULONG copied;
/* If error log is enabled, insert this message into the log buffer. */
UX_DEBUG_LOG("_ux_host_class_cdc_ecm_transmission_callback", "Freeing transmitted packet", 0, transfer_request, current_packet)
-
+
/* Free the packet that was just sent. First do some housekeeping. */
- current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
+ current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
current_packet -> nx_packet_length = current_packet -> nx_packet_length - UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
/* And ask Netx to release it. */
- nx_packet_transmit_release(current_packet);
+ nx_packet_transmit_release(current_packet);
}
else
{
@@ -207,6 +207,6 @@ ULONG copied;
}
/* There is no status to be reported back to the stack. */
- return;
+ return;
#endif
}
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_activate.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_activate.c
index 36a13a9..393d890 100644
--- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_activate.c
+++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_activate.c
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Keyboard Client */
/** */
@@ -92,52 +92,52 @@ UX_HOST_CLASS_HID_KEYBOARD_LAYOUT ux_host_class_hid_keyboard_layout =
UX_HOST_CLASS_HID_KEYBOARD_KEYS_KEYPAD_UPPER_RANGE_DEFAULT,
};
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_keyboard_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_keyboard_activate PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs the enumeration of a HID Keyboard Client. */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function performs the enumeration of a HID Keyboard Client. */
+/* */
+/* INPUT */
+/* */
/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_class_hid_periodic_report_start */
-/* Start periodic report */
+/* Start periodic report */
/* _ux_host_class_hid_report_callback_register */
-/* Register callback */
+/* Register callback */
/* _ux_host_class_hid_report_id_get Get the report ID */
/* _ux_host_class_hid_idle_set Set the idle rate */
/* _ux_host_class_hid_report_set Do SET_REPORT */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Free memory block */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Free memory block */
/* _ux_host_semaphore_create Create semaphore */
/* _ux_host_semaphore_delete Delete semaphore */
/* _ux_utility_thread_create Create thread */
/* _ux_utility_thread_delete Delete thread */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* used UX prefix to refer to */
@@ -177,7 +177,7 @@ UX_HOST_CLASS_HID_FIELD *field;
/* Get some memory for both the HID class instance and copy of this client
and for the callback. */
client_keyboard = (UX_HOST_CLASS_HID_CLIENT_KEYBOARD *)
- _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
+ _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
sizeof(UX_HOST_CLASS_HID_CLIENT_KEYBOARD));
if (client_keyboard == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
@@ -319,7 +319,7 @@ UX_HOST_CLASS_HID_FIELD *field;
to the callback because it involves using the commands on the Control Pipe which cannot
be done during callbacks. First allocate some stack memory. */
keyboard_instance -> ux_host_class_hid_keyboard_thread_stack = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
-
+
/* Check if stack memory was allocated. */
if (keyboard_instance -> ux_host_class_hid_keyboard_thread_stack == UX_NULL)
status = (UX_MEMORY_INSUFFICIENT);
@@ -328,7 +328,7 @@ UX_HOST_CLASS_HID_FIELD *field;
/* If we are OK, go on. */
if (status == UX_SUCCESS)
- /* Then create the actual thread. */
+ /* Then create the actual thread. */
status = _ux_utility_thread_create(&keyboard_instance -> ux_host_class_hid_keyboard_thread, "ux_host_stack_keyboard_thread",_ux_host_class_hid_keyboard_thread,
(ULONG) (ALIGN_TYPE) keyboard_instance, keyboard_instance -> ux_host_class_hid_keyboard_thread_stack,
UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_KEYBOARD,
@@ -376,19 +376,19 @@ UX_HOST_CLASS_HID_FIELD *field;
/* The report ID should exist. If there is an error, we do not proceed. */
if (status == UX_SUCCESS)
{
-
+
/* Memorize the report pointer. */
client_report.ux_host_class_hid_client_report = report_id.ux_host_class_hid_report_get_report;
-
+
/* The report set is raw since the LEDs mask is already in the right format. */
client_report.ux_host_class_hid_client_report_flags = UX_HOST_CLASS_HID_REPORT_RAW;
-
+
/* The length of this report is 1 byte. */
client_report.ux_host_class_hid_client_report_length = 1;
-
+
/* The output report buffer is the LED mask field. */
client_report.ux_host_class_hid_client_report_buffer = &keyboard_instance -> ux_host_class_hid_keyboard_led_mask;
-
+
/* The HID class will perform the SET_REPORT command. Do not check for error here, this is
handled by the function itself. */
status = _ux_host_class_hid_report_set(hid, &client_report);
@@ -425,7 +425,7 @@ UX_HOST_CLASS_HID_FIELD *field;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_HID_CLIENT_INSERTION, hid -> ux_host_class_hid_class, (VOID *) hid_client);
}
@@ -434,7 +434,7 @@ UX_HOST_CLASS_HID_FIELD *field;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_HID_KEYBOARD_ACTIVATE, hid, keyboard_instance, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Return completion status. */
- return(status);
+ return(status);
}
/* There is error, delete thread. */
@@ -455,7 +455,7 @@ UX_HOST_CLASS_HID_FIELD *field;
_ux_utility_memory_free(keyboard_instance -> ux_host_class_hid_keyboard_thread_stack);
/* Delete semaphore. */
- if (keyboard_instance -> ux_host_class_hid_keyboard_semaphore.tx_semaphore_id != UX_EMPTY)
+ if (_ux_host_semaphore_created(&keyboard_instance -> ux_host_class_hid_keyboard_semaphore))
_ux_host_semaphore_delete(&keyboard_instance -> ux_host_class_hid_keyboard_semaphore);
#endif
diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c b/common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c
index cde5fb7..c454b8f 100644
--- a/common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c
+++ b/common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c
@@ -1,10 +1,10 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -425,12 +425,15 @@ UINT status = UX_SUCCESS;
if (hcd_ehci -> ux_hcd_ehci_hsiso_td_list)
_ux_utility_memory_free(hcd_ehci -> ux_hcd_ehci_hsiso_td_list);
#endif
- if (hcd_ehci -> ux_hcd_ehci_periodic_mutex.tx_mutex_id != 0)
+ if (_ux_host_mutex_created(&hcd_ehci -> ux_hcd_ehci_periodic_mutex))
_ux_host_mutex_delete(&hcd_ehci -> ux_hcd_ehci_periodic_mutex);
- if (hcd_ehci -> ux_hcd_ehci_protect_semaphore.tx_semaphore_id != 0)
+
+ if (_ux_host_semaphore_created(&hcd_ehci -> ux_hcd_ehci_protect_semaphore))
_ux_host_semaphore_delete(&hcd_ehci -> ux_hcd_ehci_protect_semaphore);
- if (hcd_ehci -> ux_hcd_ehci_doorbell_semaphore.tx_semaphore_id != 0)
+
+ if (_ux_host_semaphore_created(&hcd_ehci -> ux_hcd_ehci_doorbell_semaphore))
_ux_host_semaphore_delete(&hcd_ehci -> ux_hcd_ehci_doorbell_semaphore);
+
_ux_utility_memory_free(hcd_ehci);
/* Return error status code. */
diff --git a/ports/arm9/gnu/inc/ux_port.h b/ports/arm9/gnu/inc/ux_port.h
index 7a8e2b3..b0e6cf4 100644
--- a/ports/arm9/gnu/inc/ux_port.h
+++ b/ports/arm9/gnu/inc/ux_port.h
@@ -242,10 +242,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define memory barrier instruction. */
diff --git a/ports/arm9/iar/inc/ux_port.h b/ports/arm9/iar/inc/ux_port.h
index 061cede..7815271 100644
--- a/ports/arm9/iar/inc/ux_port.h
+++ b/ports/arm9/iar/inc/ux_port.h
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +20,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h ARM9/IAR */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h ARM9/IAR */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,14 +32,14 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
/* moved tx_api.h include and */
@@ -61,7 +61,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,10 +249,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define memory barrier instruction. */
@@ -262,7 +263,7 @@ VOID outpl(ULONG,ULONG);
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
+CHAR _ux_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * USBX ARM9/IAR Version 6.4.1 *";
#else
extern CHAR _ux_version_id[];
diff --git a/ports/cortex_a15/gnu/inc/ux_port.h b/ports/cortex_a15/gnu/inc/ux_port.h
index 42bf33c..6fcc4af 100644
--- a/ports/cortex_a15/gnu/inc/ux_port.h
+++ b/ports/cortex_a15/gnu/inc/ux_port.h
@@ -242,10 +242,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_a5/gnu/inc/ux_port.h b/ports/cortex_a5/gnu/inc/ux_port.h
index bf4435c..f6107d5 100644
--- a/ports/cortex_a5/gnu/inc/ux_port.h
+++ b/ports/cortex_a5/gnu/inc/ux_port.h
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +20,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-A5/GNU */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-A5/GNU */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,14 +32,14 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
/* moved tx_api.h include and */
@@ -61,7 +61,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,16 +249,17 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
+CHAR _ux_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A5/GNU Version 6.4.1 *";
#else
extern CHAR _ux_version_id[];
diff --git a/ports/cortex_a5/iar/inc/ux_port.h b/ports/cortex_a5/iar/inc/ux_port.h
index c03566e..4acbe9a 100644
--- a/ports/cortex_a5/iar/inc/ux_port.h
+++ b/ports/cortex_a5/iar/inc/ux_port.h
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +20,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-A5/IAR */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-A5/IAR */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,14 +32,14 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
/* moved tx_api.h include and */
@@ -61,7 +61,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,16 +249,17 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
+CHAR _ux_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A5/IAR Version 6.4.1 *";
#else
extern CHAR _ux_version_id[];
diff --git a/ports/cortex_a5x/ac6/inc/ux_port.h b/ports/cortex_a5x/ac6/inc/ux_port.h
index e2c6506..23008b6 100644
--- a/ports/cortex_a5x/ac6/inc/ux_port.h
+++ b/ports/cortex_a5x/ac6/inc/ux_port.h
@@ -266,10 +266,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_a7/gnu/inc/ux_port.h b/ports/cortex_a7/gnu/inc/ux_port.h
index 53016d5..8d6ad2d 100644
--- a/ports/cortex_a7/gnu/inc/ux_port.h
+++ b/ports/cortex_a7/gnu/inc/ux_port.h
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +20,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-A7/GNU */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-A7/GNU */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,14 +32,14 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
/* moved tx_api.h include and */
@@ -61,7 +61,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,10 +249,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define memory barrier instruction. */
@@ -262,7 +263,7 @@ VOID outpl(ULONG,ULONG);
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
+CHAR _ux_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A7/GNU Version 6.4.1 *";
#else
extern CHAR _ux_version_id[];
diff --git a/ports/cortex_a7/iar/inc/ux_port.h b/ports/cortex_a7/iar/inc/ux_port.h
index 98d9089..5feda12 100644
--- a/ports/cortex_a7/iar/inc/ux_port.h
+++ b/ports/cortex_a7/iar/inc/ux_port.h
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +20,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-A7/IAR */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-A7/IAR */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,14 +32,14 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
/* moved tx_api.h include and */
@@ -61,7 +61,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,10 +249,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define memory barrier instruction. */
@@ -262,7 +263,7 @@ VOID outpl(ULONG,ULONG);
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
+CHAR _ux_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A7/IAR Version 6.4.1 *";
#else
extern CHAR _ux_version_id[];
diff --git a/ports/cortex_a8/gnu/inc/ux_port.h b/ports/cortex_a8/gnu/inc/ux_port.h
index de0b53f..d99c11d 100644
--- a/ports/cortex_a8/gnu/inc/ux_port.h
+++ b/ports/cortex_a8/gnu/inc/ux_port.h
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +20,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-A8/GNU */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-A8/GNU */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,14 +32,14 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
/* moved tx_api.h include and */
@@ -61,7 +61,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,16 +249,17 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
+CHAR _ux_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A8/GNU Version 6.4.1 *";
#else
extern CHAR _ux_version_id[];
diff --git a/ports/cortex_a8/iar/inc/ux_port.h b/ports/cortex_a8/iar/inc/ux_port.h
index c7def07..bf7d26a 100644
--- a/ports/cortex_a8/iar/inc/ux_port.h
+++ b/ports/cortex_a8/iar/inc/ux_port.h
@@ -249,10 +249,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_a9/gnu/inc/ux_port.h b/ports/cortex_a9/gnu/inc/ux_port.h
index 382cefa..ccf6d0f 100644
--- a/ports/cortex_a9/gnu/inc/ux_port.h
+++ b/ports/cortex_a9/gnu/inc/ux_port.h
@@ -249,10 +249,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_a9/iar/inc/ux_port.h b/ports/cortex_a9/iar/inc/ux_port.h
index bd423fd..bf9beff 100644
--- a/ports/cortex_a9/iar/inc/ux_port.h
+++ b/ports/cortex_a9/iar/inc/ux_port.h
@@ -249,10 +249,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_m0/gnu/inc/ux_port.h b/ports/cortex_m0/gnu/inc/ux_port.h
index 01aaf74..22fb3e8 100644
--- a/ports/cortex_m0/gnu/inc/ux_port.h
+++ b/ports/cortex_m0/gnu/inc/ux_port.h
@@ -247,10 +247,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_m0/iar/inc/ux_port.h b/ports/cortex_m0/iar/inc/ux_port.h
index 08d87b1..4fcc989 100644
--- a/ports/cortex_m0/iar/inc/ux_port.h
+++ b/ports/cortex_m0/iar/inc/ux_port.h
@@ -249,10 +249,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_m3/gnu/inc/ux_port.h b/ports/cortex_m3/gnu/inc/ux_port.h
index 42983ea..f414cc0 100644
--- a/ports/cortex_m3/gnu/inc/ux_port.h
+++ b/ports/cortex_m3/gnu/inc/ux_port.h
@@ -247,10 +247,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_m33/gnu/inc/ux_port.h b/ports/cortex_m33/gnu/inc/ux_port.h
index 06f73b0..cd06f6f 100644
--- a/ports/cortex_m33/gnu/inc/ux_port.h
+++ b/ports/cortex_m33/gnu/inc/ux_port.h
@@ -247,10 +247,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_m33/iar/inc/ux_port.h b/ports/cortex_m33/iar/inc/ux_port.h
index 9213474..b82acd2 100644
--- a/ports/cortex_m33/iar/inc/ux_port.h
+++ b/ports/cortex_m33/iar/inc/ux_port.h
@@ -249,10 +249,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_m4/gnu/inc/ux_port.h b/ports/cortex_m4/gnu/inc/ux_port.h
index 199f01d..49de2f3 100644
--- a/ports/cortex_m4/gnu/inc/ux_port.h
+++ b/ports/cortex_m4/gnu/inc/ux_port.h
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +20,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-M4/GNU */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-M4/GNU */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,14 +32,14 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
@@ -63,7 +63,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -247,16 +247,17 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
+CHAR _ux_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M4/GNU Version 6.4.1 *";
#else
extern CHAR _ux_version_id[];
diff --git a/ports/cortex_m4/iar/inc/ux_port.h b/ports/cortex_m4/iar/inc/ux_port.h
index 4554a1b..706a8c3 100644
--- a/ports/cortex_m4/iar/inc/ux_port.h
+++ b/ports/cortex_m4/iar/inc/ux_port.h
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +20,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-M4/IAR */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-M4/IAR */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,14 +32,14 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
/* moved tx_api.h include and */
@@ -61,7 +61,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,16 +249,17 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
+CHAR _ux_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M4/IAR Version 6.4.1 *";
#else
extern CHAR _ux_version_id[];
diff --git a/ports/cortex_m7/gnu/inc/ux_port.h b/ports/cortex_m7/gnu/inc/ux_port.h
index badf444..f5ba43b 100644
--- a/ports/cortex_m7/gnu/inc/ux_port.h
+++ b/ports/cortex_m7/gnu/inc/ux_port.h
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +20,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-M7/GNU */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-M7/GNU */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,14 +32,14 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
@@ -63,7 +63,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -247,16 +247,17 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
+CHAR _ux_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M7/GNU Version 6.4.1 *";
#else
extern CHAR _ux_version_id[];
diff --git a/ports/cortex_m7/iar/inc/ux_port.h b/ports/cortex_m7/iar/inc/ux_port.h
index 6c36c82..30eb3e6 100644
--- a/ports/cortex_m7/iar/inc/ux_port.h
+++ b/ports/cortex_m7/iar/inc/ux_port.h
@@ -1,18 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +20,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-M7/IAR */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-M7/IAR */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,14 +32,14 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
/* moved tx_api.h include and */
@@ -61,7 +61,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,16 +249,17 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
+CHAR _ux_version_id[] =
"Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M7/IAR Version 6.4.1 *";
#else
extern CHAR _ux_version_id[];
diff --git a/ports/cortex_r4/gnu/inc/ux_port.h b/ports/cortex_r4/gnu/inc/ux_port.h
index 1e1067e..b414a4f 100644
--- a/ports/cortex_r4/gnu/inc/ux_port.h
+++ b/ports/cortex_r4/gnu/inc/ux_port.h
@@ -246,10 +246,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_r4/iar/inc/ux_port.h b/ports/cortex_r4/iar/inc/ux_port.h
index 3f2cd2e..af47d6f 100644
--- a/ports/cortex_r4/iar/inc/ux_port.h
+++ b/ports/cortex_r4/iar/inc/ux_port.h
@@ -249,10 +249,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_r5/gnu/inc/ux_port.h b/ports/cortex_r5/gnu/inc/ux_port.h
index 6da10b7..ac23093 100644
--- a/ports/cortex_r5/gnu/inc/ux_port.h
+++ b/ports/cortex_r5/gnu/inc/ux_port.h
@@ -249,11 +249,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
-
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/cortex_r5/iar/inc/ux_port.h b/ports/cortex_r5/iar/inc/ux_port.h
index e6c6a7c..a602396 100644
--- a/ports/cortex_r5/iar/inc/ux_port.h
+++ b/ports/cortex_r5/iar/inc/ux_port.h
@@ -250,9 +250,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/generic/inc/ux_port.h b/ports/generic/inc/ux_port.h
index c95dfcd..7e8c6c3 100644
--- a/ports/generic/inc/ux_port.h
+++ b/ports/generic/inc/ux_port.h
@@ -250,11 +250,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
-
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
diff --git a/ports/linux/gnu/inc/ux_port.h b/ports/linux/gnu/inc/ux_port.h
index 406c35f..68172f2 100644
--- a/ports/linux/gnu/inc/ux_port.h
+++ b/ports/linux/gnu/inc/ux_port.h
@@ -251,10 +251,11 @@ ULONG outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */