ADuCM302x Device Drivers API Reference Manual
Release 3.1.2.0
adi_rtos_map_freertos.h
1
47
#ifndef ADI_RTOS_MAP_FREERTOS_H
48
#define ADI_RTOS_MAP_FREERTOS_H
49
50
/* If building a c file */
51
#if defined(__STDC__)
52
53
#include <FreeRTOS.h>
54
#include "semphr.h"
55
56
extern
BaseType_t xHigherPriorityTaskWoken;
57
61
#define SEM_VAR_DECLR \
62
StaticQueue_t hSemaphore;
63
68
#define ADI_SEM_SIZE (sizeof(StaticQueue_t))
69
73
#define SEM_CREATE(DEV, name, error) \
74
do { \
75
xSemaphoreCreateBinaryStatic(&(DEV)->hSemaphore); \
76
} while (0)
77
79
#define SEM_DELETE(DEV, error) \
80
do { \
81
vSemaphoreDelete (&(DEV)->hSemaphore); \
82
} while (0)
83
84
86
#define SEM_PEND(DEV, error) \
87
do { \
88
if(xSemaphoreTake (&(DEV)->hSemaphore, portMAX_DELAY) != pdTRUE) \
89
return((error)); \
90
} while (0)
91
93
/* Note that priority inversion is supported */
94
#define SEM_POST(DEV) \
95
do { \
96
/* Assume that a higher priority task can be schedule in */
\
97
BaseType_t xHigherPriorityTaskWoken = pdTRUE; \
98
xSemaphoreGiveFromISR(&(DEV)->hSemaphore, &xHigherPriorityTaskWoken); \
99
} while (0)
100
109
#define ADI_INT_STATUS_ALLOC()
110
117
#define ADI_ENTER_CRITICAL_REGION() vPortEnterCritical()
118
125
#define ADI_EXIT_CRITICAL_REGION() vPortExitCritical()
126
130
#define ISR_PROLOG()
131
135
#define ISR_EPILOG() portYIELD()
136
137
#endif
/* __STDC__ */
138
139
#define PENDSV_HANDLER xPortPendSVHandler
140
#define SYSTICK_HANDLER xPortSysTickHandler
141
#define SVC_HANDLER vPortSVCHandler
142
143
#ifndef ADI_MAX_IRQ_PRIORITY
144
/* For FreeRTOS we do not want to use the default priorities for IRQ interrupts. */
145
#define ADI_MAX_IRQ_PRIORITY (1u)
146
#endif
147
148
#endif
/* ADI_RTOS_MAP_FREERTOS_H */
Include
rtos_map
adi_rtos_map_freertos.h
Generated on Mon Aug 6 2018 21:48:22 for ADuCM302x Device Drivers API Reference Manual by
1.8.13