diff --git a/src/platforms/freertos/freertos_headers.h b/src/platforms/freertos/freertos_headers.h new file mode 100644 index 0000000000..f82d0abcd0 --- /dev/null +++ b/src/platforms/freertos/freertos_headers.h @@ -0,0 +1,13 @@ + +#ifdef WITH_FREE_RTOS_DIR + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/semphr.h" + +#else +#include "FreeRTOS.h" +#include "task.h" +#include "semphr.h" + +#endif/*WITH_FREE_RTOS_DIR*/ diff --git a/src/platforms/freertos/mutex.c b/src/platforms/freertos/mutex.c index 1f2572524a..819251ff7d 100644 --- a/src/platforms/freertos/mutex.c +++ b/src/platforms/freertos/mutex.c @@ -19,12 +19,11 @@ * */ -#include "FreeRTOS.h" -#include "semphr.h" - #include "tkc/mem.h" #include "tkc/mutex.h" +#include "freertos_headers.h" + struct _tk_mutex_t { SemaphoreHandle_t mutex; }; diff --git a/src/platforms/freertos/rtos.c b/src/platforms/freertos/rtos.c index 0e75499f7c..36b47674f5 100644 --- a/src/platforms/freertos/rtos.c +++ b/src/platforms/freertos/rtos.c @@ -19,9 +19,8 @@ * */ -#include "FreeRTOS.h" -#include "task.h" #include "platforms/common/rtos.h" +#include "freertos_headers.h" static bool_t s_is_running = FALSE; diff --git a/src/platforms/freertos/semaphore.c b/src/platforms/freertos/semaphore.c index 082f704a11..da5a335b93 100644 --- a/src/platforms/freertos/semaphore.c +++ b/src/platforms/freertos/semaphore.c @@ -19,14 +19,13 @@ * */ -#include "FreeRTOS.h" -#include "semphr.h" - #include "tkc/mem.h" #include "tkc/time_now.h" #include "tkc/platform.h" #include "tkc/semaphore.h" +#include "freertos_headers.h" + struct _tk_semaphore_t { SemaphoreHandle_t sem; }; diff --git a/src/platforms/freertos/thread.c b/src/platforms/freertos/thread.c index c8290ad035..4b69844ed8 100644 --- a/src/platforms/freertos/thread.c +++ b/src/platforms/freertos/thread.c @@ -23,8 +23,8 @@ #include "tkc/utils.h" #include "tkc/thread.h" #include "tkc/mutex.h" -#include "FreeRTOS.h" -#include "task.h" + +#include "freertos_headers.h" struct _tk_thread_t { void* args;