ADuCM4x50 Device Drivers API Reference Manual
Release 4.0.0.0
adi_rtos_map_ucos_ii.h
1
14
#ifndef ADI_RTOS_MAP_UCOS_II_H
15
#define ADI_RTOS_MAP_UCOS_II_H
16
17
/* If building a c file */
18
#if defined(__STDC__)
19
20
#include <ucos_ii.h>
21
22
#include <stdint.h>
23
#include <stddef.h>
24
28
#define SEM_VAR_DECLR \
29
OS_EVENT *hSemaphore;
30
36
#define ADI_SEM_SIZE (sizeof(OS_EVENT*))
37
43
#define SEM_CREATE(DEV, name, error) \
44
do { \
45
(DEV)->hSemaphore = OSSemCreate(0u); \
46
if((DEV)->hSemaphore == NULL) {return((error));} \
47
} while (0)
48
52
#define SEM_DELETE(DEV, error) \
53
do { \
54
INT8U nErr; \
55
OSSemDel( (DEV)->hSemaphore, OS_DEL_NO_PEND, &nErr );\
56
if(OS_ERR_NONE != nErr) {return((error));} \
57
} while (0)
58
62
#define SEM_PEND(DEV, error) \
63
do { \
64
INT8U nErr; \
65
OSSemPend((DEV)->hSemaphore, 0u, &nErr); \
66
if(OS_ERR_NONE != nErr) {return((error));} \
67
} while (0)
68
71
#define SEM_POST(DEV) \
72
do { \
73
OSSemPost((DEV)->hSemaphore); \
74
} while (0)
75
76
85
#define ADI_INT_STATUS_ALLOC() OS_CPU_SR cpu_sr
86
93
#define ADI_ENTER_CRITICAL_REGION() OS_ENTER_CRITICAL()
94
101
#define ADI_EXIT_CRITICAL_REGION() OS_EXIT_CRITICAL()
102
106
#define ISR_PROLOG() \
107
do { \
108
OS_CPU_SR cpu_sr; \
109
OS_ENTER_CRITICAL(); \
110
OSIntEnter(); \
111
OS_EXIT_CRITICAL(); \
112
} while (0);
113
117
#define ISR_EPILOG() \
118
do { \
119
OSIntExit(); \
120
} while (0); \
121
122
#endif
/* __STDC__ */
123
124
#define PENDSV_HANDLER OS_CPU_PendSVHandler
125
#define SYSTICK_HANDLER OS_CPU_SysTickHandler
126
#define SVC_HANDLER SVC_Handler
127
128
129
#endif
/* ADI_RTOS_MAP_UCOS_II_H */
Include
rtos_map
adi_rtos_map_ucos_ii.h
Generated on Tue Aug 31 2021 19:04:42 for ADuCM4x50 Device Drivers API Reference Manual by
1.8.15