Skip to content

Commit

Permalink
improve freertos
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Dec 31, 2024
1 parent 1994322 commit e11ff52
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
13 changes: 13 additions & 0 deletions src/platforms/freertos/freertos_headers.h
Original file line number Diff line number Diff line change
@@ -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*/
5 changes: 2 additions & 3 deletions src/platforms/freertos/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
3 changes: 1 addition & 2 deletions src/platforms/freertos/rtos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 2 additions & 3 deletions src/platforms/freertos/semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/freertos/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e11ff52

Please sign in to comment.