ADuCM4x50 Device Drivers API Reference Manual
Release 4.0.0.0
adi_rtos_map_freertos.h
1
14
#ifndef ADI_RTOS_MAP_FREERTOS_H
15
#define ADI_RTOS_MAP_FREERTOS_H
16
17
/* If building a c file */
18
#if defined(__STDC__)
19
20
#include <FreeRTOS.h>
21
#include "semphr.h"
22
23
extern
BaseType_t xHigherPriorityTaskWoken;
24
28
#define SEM_VAR_DECLR \
29
StaticQueue_t hSemaphore;
30
35
#define ADI_SEM_SIZE (sizeof(StaticQueue_t))
36
40
#define SEM_CREATE(DEV, name, error) \
41
do { \
42
xSemaphoreCreateBinaryStatic(&(DEV)->hSemaphore); \
43
} while (0)
44
46
#define SEM_DELETE(DEV, error) \
47
do { \
48
vSemaphoreDelete (&(DEV)->hSemaphore); \
49
} while (0)
50
51
53
#define SEM_PEND(DEV, error) \
54
do { \
55
if(xSemaphoreTake ((SemaphoreHandle_t)&(DEV)->hSemaphore, portMAX_DELAY) != pdTRUE) \
56
return((error)); \
57
} while (0)
58
60
/* Note that priority inversion is supported */
61
#define SEM_POST(DEV) \
62
do { \
63
/* Assume that a higher priority task can be schedule in */
\
64
BaseType_t xHigherPriorityTaskWoken = pdTRUE; \
65
xSemaphoreGiveFromISR(&(DEV)->hSemaphore, &xHigherPriorityTaskWoken); \
66
} while (0)
67
76
#define ADI_INT_STATUS_ALLOC() uint32_t IntStatus = 0u
77
84
#define ADI_ENTER_CRITICAL_REGION() \
85
do { \
86
IntStatus = __get_PRIMASK(); \
87
__disable_irq(); \
88
} while (0)
89
96
#define ADI_EXIT_CRITICAL_REGION() \
97
do { \
98
__set_PRIMASK(IntStatus); \
99
} while (0)
100
104
#define ISR_PROLOG()
105
109
#define ISR_EPILOG() portYIELD()
110
111
#endif
/* __STDC__ */
112
113
#define PENDSV_HANDLER xPortPendSVHandler
114
#define SYSTICK_HANDLER xPortSysTickHandler
115
#define SVC_HANDLER vPortSVCHandler
116
117
#ifndef ADI_MAX_IRQ_PRIORITY
118
/* For FreeRTOS we do not want to use the default priorities for IRQ interrupts. */
119
#define ADI_MAX_IRQ_PRIORITY (1u)
120
#endif
121
122
#endif
/* ADI_RTOS_MAP_FREERTOS_H */
Include
rtos_map
adi_rtos_map_freertos.h
Generated on Tue Aug 31 2021 19:04:42 for ADuCM4x50 Device Drivers API Reference Manual by
1.8.15