-
Notifications
You must be signed in to change notification settings - Fork 0
Refer to ux internal marco instead of using direct tx #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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) | ||||||||||||||||||||||
|
||||||||||||||||||||||
| #define _ux_device_mutex_suspended_count(m) ((m)->tx_mutex_suspended_count) | |
| #define _ux_device_mutex_suspended_count(m) ((m)->tx_mutex_suspended_count) | |
| #else /* !TX_API_H */ | |
| #define _ux_device_thread_entry(t) ((UX_THREAD_ENTRY)t) | |
| #define _ux_device_thread_created(t) (UX_FALSE) | |
| #define _ux_device_semaphore_created(sem) (UX_FALSE) | |
| #define _ux_device_semaphore_waiting(sem) (UX_FALSE) | |
| #define _ux_device_event_flags_created(e) (UX_FALSE) | |
| #define _ux_device_mutex_created(m) (UX_FALSE) | |
| #define _ux_device_mutex_suspended_count(m) (0) |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When TX_API_H is not defined, the macros _ux_host_thread_entry, _ux_host_thread_created, _ux_host_semaphore_created, _ux_host_semaphore_waiting, _ux_host_event_flags_created, _ux_host_mutex_created, and _ux_host_mutex_suspended_count are not defined for the non-standalone case. These need fallback definitions for non-ThreadX environments.
| #define _ux_host_mutex_suspended_count(m) ((m)->tx_mutex_suspended_count) | |
| #define _ux_host_mutex_suspended_count(m) ((m)->tx_mutex_suspended_count) | |
| #else | |
| #define _ux_host_thread_entry(t) (UX_NULL) | |
| #define _ux_host_thread_created(t) (UX_FALSE) | |
| #define _ux_host_semaphore_created(sem) (UX_FALSE) | |
| #define _ux_host_semaphore_waiting(sem) (UX_FALSE) | |
| #define _ux_host_event_flags_created(e) (UX_FALSE) | |
| #define _ux_host_mutex_created(m) (UX_FALSE) | |
| #define _ux_host_mutex_suspended_count(m) (0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When TX_API_H is not defined, the macro _ux_host_mutex_created is not defined for the non-standalone case. This will cause compilation errors when USBX is used without ThreadX. Similar macros like _ux_system_thread_entry, _ux_system_mutex_created, and _ux_system_mutex_suspended_count also lack fallback definitions when TX_API_H is not defined in the non-standalone UX_STANDALONE case. These macros need fallback definitions that work without ThreadX.