9 #ifndef __ewf_platform_threadx__h__included__
10 #define __ewf_platform_threadx__h__included__
14 #ifndef EWF_PLATFORM_THREADX
15 #error EWF_PLATFORM_THREADX must be defined before including this file
39 #ifndef EWF_PLATFORM_TICKS_PER_SECOND
41 #define EWF_PLATFORM_TICKS_PER_SECOND (TX_TIMER_TICKS_PER_SECOND)
44 #ifndef EWF_PLATFORM_THREAD_PRIORITY_HIGH
46 #define EWF_PLATFORM_THREAD_PRIORITY_HIGH (1)
49 #ifndef EWF_PLATFORM_THREAD_PRIORITY_MEDIUM
51 #define EWF_PLATFORM_THREAD_PRIORITY_MEDIUM (7)
54 #ifndef EWF_PLATFORM_THREAD_PRIORITY_LOW
56 #define EWF_PLATFORM_THREAD_PRIORITY_LOW (15)
70 ewf_platform_thread_function thread_function_ptr;
71 void* thread_function_data;
75 UINT preempt_threshold;
87 #define EWF_PLATFORM_THREAD_STATIC_DECLARE(thread_ptr, thread_name_symb, thread_function_ptr_param, thread_function_data_param, stack_size_param, thread_priority_param) \
89 static ULONG _ewf_platform_thread__stack__##thread_name_symb[stack_size_param / sizeof(ULONG)]; \
90 static struct _ewf_platform_thread _ewf_platform_thread__##thread_name_symb = {0}; \
91 _ewf_platform_thread__##thread_name_symb.name_cstr = #thread_name_symb; \
92 _ewf_platform_thread__##thread_name_symb.thread_function_ptr = thread_function_ptr_param; \
93 _ewf_platform_thread__##thread_name_symb.thread_function_data = thread_function_data_param; \
94 _ewf_platform_thread__##thread_name_symb.stack_ptr = _ewf_platform_thread__stack__##thread_name_symb; \
95 _ewf_platform_thread__##thread_name_symb.stack_size = stack_size_param; \
96 _ewf_platform_thread__##thread_name_symb.priority = thread_priority_param; \
97 _ewf_platform_thread__##thread_name_symb.preempt_threshold = thread_priority_param; \
98 _ewf_platform_thread__##thread_name_symb.time_slice = 1; \
99 thread_ptr = &(_ewf_platform_thread__##thread_name_symb); \
117 #define EWF_PLATFORM_MUTEX_STATIC_DECLARE(mutex_ptr, mutex_name_symb) \
119 static struct _ewf_platform_mutex _ewf_platform_mutex__##mutex_name_symb = {0}; \
120 _ewf_platform_mutex__##mutex_name_symb.name_cstr = #mutex_name_symb; \
121 mutex_ptr = &(_ewf_platform_mutex__##mutex_name_symb); \
143 #define EWF_PLATFORM_QUEUE_STATIC_DECLARE(queue_ptr, queue_name_symb, item_type, item_count) \
145 static ULONG _ewf_platform_queue__buffer__##queue_name_symb[sizeof(item_type) * item_count]; \
146 static ewf_platform_queue _ewf_platform_queue__##queue_name_symb = {0}; \
147 _ewf_platform_queue__##queue_name_symb.name_cstr = #queue_name_symb; \
148 _ewf_platform_queue__##queue_name_symb.message_size = sizeof(item_type); \
149 _ewf_platform_queue__##queue_name_symb.queue_start = _ewf_platform_queue__buffer__##queue_name_symb; \
150 _ewf_platform_queue__##queue_name_symb.queue_size = sizeof(_ewf_platform_queue__buffer__##queue_name_symb); \
151 queue_ptr = &(_ewf_platform_queue__##queue_name_symb); \