summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Soest <[email protected]>2026-02-16 10:28:30 +0100
committerLaurent Soest <[email protected]>2026-02-16 10:28:30 +0100
commit596f94be06dc5bc1df4d7685be231a947e4665d9 (patch)
treeae870cb200bfac9b49389df16a554208500184aa
parent515c9a431bd7bb8ae553ce33a9b5dd6a3d165474 (diff)
create mutex before calling _ux_utility_memory_allocate
When compiling with UX_ENABLE_DEBUG_LOG the call to _ux_utility_memory_allocate requires the system mutex.
-rw-r--r--common/core/src/ux_system_initialize.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/core/src/ux_system_initialize.c b/common/core/src/ux_system_initialize.c
index a3e27c4..443ee9a 100644
--- a/common/core/src/ux_system_initialize.c
+++ b/common/core/src/ux_system_initialize.c
@@ -261,6 +261,14 @@ ULONG pool_size;
/* Other fields are kept zero. */
#endif
+#if !defined(UX_STANDALONE)
+
+ /* Create the Mutex object used by USBX to control critical sections. */
+ status = _ux_system_mutex_create(&_ux_system -> ux_system_mutex, "ux_system_mutex");
+ if(status != UX_SUCCESS)
+ return(UX_MUTEX_ERROR);
+#endif
+
#ifdef UX_ENABLE_DEBUG_LOG
/* Obtain memory for storing the debug log. */
@@ -277,14 +285,6 @@ ULONG pool_size;
#endif
-#if !defined(UX_STANDALONE)
-
- /* Create the Mutex object used by USBX to control critical sections. */
- status = _ux_system_mutex_create(&_ux_system -> ux_system_mutex, "ux_system_mutex");
- if(status != UX_SUCCESS)
- return(UX_MUTEX_ERROR);
-#endif
-
return(UX_SUCCESS);
}