ADuCM302x Device Drivers API Reference Manual
Release 3.1.2.0
adi_rtos_map_ucos_ii.h
1
47
#ifndef ADI_RTOS_MAP_UCOS_II_H
48
#define ADI_RTOS_MAP_UCOS_II_H
49
50
/* If building a c file */
51
#if defined(__STDC__)
52
53
#include <ucos_ii.h>
54
55
#include <stdint.h>
56
#include <stddef.h>
57
61
#define SEM_VAR_DECLR \
62
OS_EVENT *hSemaphore;
63
69
#define ADI_SEM_SIZE (sizeof(OS_EVENT*))
70
76
#define SEM_CREATE(DEV, name, error) \
77
do { \
78
(DEV)->hSemaphore = OSSemCreate(0u); \
79
if((DEV)->hSemaphore == NULL) {return((error));} \
80
} while (0)
81
85
#define SEM_DELETE(DEV, error) \
86
do { \
87
INT8U nErr; \
88
OSSemDel( (DEV)->hSemaphore, OS_DEL_NO_PEND, &nErr );\
89
if(OS_ERR_NONE != nErr) {return((error));} \
90
} while (0)
91
95
#define SEM_PEND(DEV, error) \
96
do { \
97
INT8U nErr; \
98
OSSemPend((DEV)->hSemaphore, 0u, &nErr); \
99
if(OS_ERR_NONE != nErr) {return((error));} \
100
} while (0)
101
104
#define SEM_POST(DEV) \
105
do { \
106
OSSemPost((DEV)->hSemaphore); \
107
} while (0)
108
109
118
#define ADI_INT_STATUS_ALLOC() OS_CPU_SR cpu_sr
119
126
#define ADI_ENTER_CRITICAL_REGION() OS_ENTER_CRITICAL()
127
134
#define ADI_EXIT_CRITICAL_REGION() OS_EXIT_CRITICAL()
135
139
#define ISR_PROLOG() \
140
do { \
141
OS_CPU_SR cpu_sr; \
142
OS_ENTER_CRITICAL(); \
143
OSIntEnter(); \
144
OS_EXIT_CRITICAL(); \
145
} while (0);
146
150
#define ISR_EPILOG() \
151
do { \
152
OSIntExit(); \
153
} while (0); \
154
155
#endif
/* __STDC__ */
156
157
#define PENDSV_HANDLER OS_CPU_PendSVHandler
158
#define SYSTICK_HANDLER OS_CPU_SysTickHandler
159
#define SVC_HANDLER SVC_Handler
160
161
162
#endif
/* ADI_RTOS_MAP_UCOS_II_H */
Include
rtos_map
adi_rtos_map_ucos_ii.h
Generated on Mon Aug 6 2018 21:48:22 for ADuCM302x Device Drivers API Reference Manual by
1.8.13