app_rtos_cfg.h
Go to the documentation of this file.
1
52 #ifndef __APP_RTOS_ADAPTER_H
53 #define __APP_RTOS_ADAPTER_H
54 /*
55 * INCLUDE FILES
56 *****************************************************************************************
57 */
58 #include <string.h>
59 #include <stdint.h>
60
61 #ifdef ENV_USE_FREERTOS
62
63 #include "FreeRTOS.h"
64 #include "semphr.h"
65
69 #define ENV_USE_RTOS
70
80 typedef SemaphoreHandle_t sem_t;
81
85 typedef SemaphoreHandle_t mutex_t;
86
92 #define OS_WAIT_FOREVER portMAX_DELAY
94 #define SEM_WAIT_FOREVER portMAX_DELAY
95 #define SEM_NO_WAIT (0)
97 #define MUTEX_WAIT_FOREVER portMAX_DELAY
98 #define MUTEX_NO_WAIT (0)
101 #else
102
107 typedef void * sem_t;
108 typedef void * mutex_t;
114 #define SEM_WAIT_FOREVER (0xFFFFUL)
115 #define SEM_NO_WAIT (0)
117 #define MUTEX_WAIT_FOREVER (0xFFFFUL)
118 #define MUTEX_NO_WAIT (0)
121 #endif
122
126 #define APP_DRV_SEM_DECL(sem) sem_t sem
127 #define APP_DRV_MUTEX_DECL(mutex) mutex_t mutex
130 #ifdef ENV_USE_RTOS
131
134 #define ENV_RTOS_USE_SEMP 1
135 //#define ENV_RTOS_USE_MUTEX 1
150 uint16_t app_driver_sem_init(sem_t *sem);
151
161 void app_driver_sem_deinit(sem_t sem);
162
174 uint16_t app_driver_sem_pend(sem_t sem, uint32_t time_out);
175
186 uint16_t app_driver_sem_post(sem_t sem);
187
198 uint16_t app_driver_sem_post_from_isr(sem_t sem);
199
209 uint16_t app_driver_mutex_init(mutex_t *mutex);
210
220 void app_driver_mutex_deinit(mutex_t mutex);
221
233 uint16_t app_driver_mutex_pend(mutex_t mutex, uint32_t time_out);
234
245 uint16_t app_driver_mutex_post(mutex_t mutex);
248 #else
249
252 #define app_driver_sem_init(x) (0)
253 #define app_driver_sem_deinit(x)
254 #define app_driver_sem_pend(x, y) (0)
255 #define app_driver_sem_post(x)
256 #define app_driver_sem_post_from_isr(x)
258 #define app_driver_mutex_init(x) (0)
259 #define app_driver_mutex_deinit(x)
260 #define app_driver_mutex_pend(x, y)
261 #define app_driver_mutex_post(x)
264 #endif
265
266 #endif
267
app_driver_sem_post_from_isr
#define app_driver_sem_post_from_isr(x)
Definition: app_rtos_cfg.h:256
app_driver_sem_deinit
#define app_driver_sem_deinit(x)
Definition: app_rtos_cfg.h:253
app_driver_mutex_deinit
#define app_driver_mutex_deinit(x)
Definition: app_rtos_cfg.h:259
app_driver_mutex_pend
#define app_driver_mutex_pend(x, y)
Definition: app_rtos_cfg.h:260
app_driver_mutex_post
#define app_driver_mutex_post(x)
Definition: app_rtos_cfg.h:261
app_driver_sem_post
#define app_driver_sem_post(x)
Definition: app_rtos_cfg.h:255
app_driver_mutex_init
#define app_driver_mutex_init(x)
Definition: app_rtos_cfg.h:258
app_driver_sem_pend
#define app_driver_sem_pend(x, y)
Definition: app_rtos_cfg.h:254