Skip to content

Commit 596f94b

Browse files
committed
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.
1 parent 515c9a4 commit 596f94b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

common/core/src/ux_system_initialize.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,14 @@ ULONG pool_size;
261261
/* Other fields are kept zero. */
262262
#endif
263263

264+
#if !defined(UX_STANDALONE)
265+
266+
/* Create the Mutex object used by USBX to control critical sections. */
267+
status = _ux_system_mutex_create(&_ux_system -> ux_system_mutex, "ux_system_mutex");
268+
if(status != UX_SUCCESS)
269+
return(UX_MUTEX_ERROR);
270+
#endif
271+
264272
#ifdef UX_ENABLE_DEBUG_LOG
265273

266274
/* Obtain memory for storing the debug log. */
@@ -277,14 +285,6 @@ ULONG pool_size;
277285

278286
#endif
279287

280-
#if !defined(UX_STANDALONE)
281-
282-
/* Create the Mutex object used by USBX to control critical sections. */
283-
status = _ux_system_mutex_create(&_ux_system -> ux_system_mutex, "ux_system_mutex");
284-
if(status != UX_SUCCESS)
285-
return(UX_MUTEX_ERROR);
286-
#endif
287-
288288
return(UX_SUCCESS);
289289
}
290290

0 commit comments

Comments
 (0)