9 #ifndef __ewf_platform_freertos__h__included__
10 #define __ewf_platform_freertos__h__included__
31 #define EWF_PLATFORM_TICKS_PER_SECOND (configTICK_RATE_HZ)
34 #define EWF_PLATFORM_THREAD_PRIORITY_HIGH (configMAX_PRIORITIES - 1)
35 #define EWF_PLATFORM_THREAD_PRIORITY_MEDIUM (configMAX_PRIORITIES / 2)
36 #define EWF_PLATFORM_THREAD_PRIORITY_LOW (1)
46 ewf_platform_thread_function thread_function_ptr;
47 void* thread_function_data;
48 StackType_t * stack_ptr;
51 TaskHandle_t task_handle;
54 #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) \
56 static StackType_t _ewf_platform_thread__stack__##thread_name_symb[stack_size_param / sizeof(StackType_t ) + 1]; \
57 static struct _ewf_platform_thread _ewf_platform_thread__##thread_name_symb = {0}; \
58 _ewf_platform_thread__##thread_name_symb.name_ptr = #thread_name_symb; \
59 _ewf_platform_thread__##thread_name_symb.thread_function_ptr = thread_function_ptr_param; \
60 _ewf_platform_thread__##thread_name_symb.thread_function_data = thread_function_data_param; \
61 _ewf_platform_thread__##thread_name_symb.stack_ptr = _ewf_platform_thread__stack__##thread_name_symb; \
62 _ewf_platform_thread__##thread_name_symb.stack_size = stack_size_param / sizeof(StackType_t); \
63 _ewf_platform_thread__##thread_name_symb.priority = thread_priority_param; \
64 _ewf_platform_thread__##thread_name_symb.task_handle = NULL; \
65 thread_ptr = &(_ewf_platform_thread__##thread_name_symb); \
70 SemaphoreHandle_t semaphore_handle;
71 StaticSemaphore_t semaphore;
74 #define EWF_PLATFORM_MUTEX_STATIC_DECLARE(mutex_ptr, mutex_name) \
76 static struct _ewf_platform_mutex _ewf_platform_mutex__##mutex_name = {0}; \
77 mutex_ptr = &(_ewf_platform_mutex__##mutex_name); \
86 StaticQueue_t xStaticQueue;
88 uint32_t message_size;
89 UBaseType_t uxQueueLength;
90 UBaseType_t uxItemSize;
91 uint8_t* pucQueueStorageBuffer;
101 #define EWF_PLATFORM_QUEUE_STATIC_DECLARE(queue_ptr, queue_name_symb, item_type_param, item_count_param) \
103 static uint8_t ewf_platform_queue__buffer__##queue_name_symb[sizeof(item_type_param) * item_count_param]; \
104 static ewf_platform_queue ewf_platform_queue__##queue_name_symb = {0}; \
105 ewf_platform_queue__##queue_name_symb.name_cstr = #queue_name_symb; \
106 ewf_platform_queue__##queue_name_symb.uxQueueLength = item_count_param; \
107 ewf_platform_queue__##queue_name_symb.uxItemSize = sizeof(item_type_param); \
108 ewf_platform_queue__##queue_name_symb.pucQueueStorageBuffer = ewf_platform_queue__buffer__##queue_name_symb; \
109 queue_ptr = &(ewf_platform_queue__##queue_name_symb); \