]> git.sur5r.net Git - freertos/blob - Source/include/FreeRTOS.h
Correct sample code for recursive mutexes.
[freertos] / Source / include / FreeRTOS.h
1 /*\r
2         FreeRTOS.org V4.7.1 - Copyright (C) 2003-2008 Richard Barry.\r
3 \r
4         This file is part of the FreeRTOS.org distribution.\r
5 \r
6         FreeRTOS.org is free software; you can redistribute it and/or modify\r
7         it under the terms of the GNU General Public License as published by\r
8         the Free Software Foundation; either version 2 of the License, or\r
9         (at your option) any later version.\r
10 \r
11         FreeRTOS.org is distributed in the hope that it will be useful,\r
12         but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14         GNU General Public License for more details.\r
15 \r
16         You should have received a copy of the GNU General Public License\r
17         along with FreeRTOS.org; if not, write to the Free Software\r
18         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
19 \r
20         A special exception to the GPL can be applied should you wish to distribute\r
21         a combined work that includes FreeRTOS.org, without being obliged to provide\r
22         the source code for any proprietary components.  See the licensing section\r
23         of http://www.FreeRTOS.org for full details of how and when the exception\r
24         can be applied.\r
25 \r
26         ***************************************************************************\r
27 \r
28         Please ensure to read the configuration and relevant port sections of the \r
29         online documentation.\r
30 \r
31         +++ http://www.FreeRTOS.org +++\r
32         Documentation, latest information, license and contact details.  \r
33 \r
34         +++ http://www.SafeRTOS.com +++\r
35         A version that is certified for use in safety critical systems.\r
36 \r
37         +++ http://www.OpenRTOS.com +++\r
38         Commercial support, development, porting, licensing and training services.\r
39 \r
40         ***************************************************************************\r
41 */\r
42 \r
43 #ifndef INC_FREERTOS_H\r
44 #define INC_FREERTOS_H\r
45 \r
46 \r
47 /*\r
48  * Include the generic headers required for the FreeRTOS port being used.\r
49  */\r
50 #include <stddef.h>\r
51 \r
52 /* Basic FreeRTOS definitions. */\r
53 #include "projdefs.h"\r
54 \r
55 /* Application specific configuration options. */\r
56 #include "FreeRTOSConfig.h"\r
57 \r
58 /* Definitions specific to the port being used. */\r
59 #include "portable.h"\r
60 \r
61 \r
62 \r
63 \r
64 \r
65 \r
66 \r
67 /*\r
68  * Check all the required application specific macros have been defined.\r
69  * These macros are application specific and (as downloaded) are defined\r
70  * within FreeRTOSConfig.h.\r
71  */\r
72 \r
73 #ifndef configUSE_PREEMPTION\r
74         #error Missing definition:  configUSE_PREEMPTION should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
75 #endif\r
76 \r
77 #ifndef configUSE_IDLE_HOOK\r
78         #error Missing definition:  configUSE_IDLE_HOOK should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
79 #endif\r
80 \r
81 #ifndef configUSE_TICK_HOOK\r
82         #error Missing definition:  configUSE_TICK_HOOK should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
83 #endif\r
84 \r
85 #ifndef configUSE_CO_ROUTINES\r
86         #error  Missing definition:  configUSE_CO_ROUTINES should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
87 #endif\r
88 \r
89 #ifndef INCLUDE_vTaskPrioritySet\r
90         #error Missing definition:  INCLUDE_vTaskPrioritySet should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
91 #endif\r
92 \r
93 #ifndef INCLUDE_uxTaskPriorityGet\r
94         #error Missing definition:  INCLUDE_uxTaskPriorityGet should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
95 #endif\r
96 \r
97 #ifndef INCLUDE_vTaskDelete             \r
98         #error Missing definition:  INCLUDE_vTaskDelete          should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
99 #endif\r
100 \r
101 #ifndef INCLUDE_vTaskCleanUpResources\r
102         #error Missing definition:  INCLUDE_vTaskCleanUpResources should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
103 #endif\r
104 \r
105 #ifndef INCLUDE_vTaskSuspend    \r
106         #error Missing definition:  INCLUDE_vTaskSuspend         should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
107 #endif\r
108 \r
109 #ifndef INCLUDE_vTaskDelayUntil\r
110         #error Missing definition:  INCLUDE_vTaskDelayUntil should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
111 #endif\r
112 \r
113 #ifndef INCLUDE_vTaskDelay\r
114         #error Missing definition:  INCLUDE_vTaskDelay should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
115 #endif\r
116 \r
117 #ifndef configUSE_16_BIT_TICKS\r
118         #error Missing definition:  configUSE_16_BIT_TICKS should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
119 #endif\r
120 \r
121 #ifndef configUSE_RECURSIVE_MUTEXES\r
122         #define configUSE_RECURSIVE_MUTEXES 0\r
123 #endif\r
124 \r
125 #ifndef configUSE_MUTEXES\r
126         #define configUSE_MUTEXES 0\r
127 #endif\r
128 \r
129 #ifndef configUSE_COUNTING_SEMAPHORES\r
130         #define configUSE_COUNTING_SEMAPHORES 0\r
131 #endif\r
132 \r
133 #ifndef configUSE_ALTERNATIVE_API\r
134         #define configUSE_ALTERNATIVE_API 0\r
135 #endif\r
136 \r
137 #if ( configUSE_MUTEXES == 1 )\r
138         /* xTaskGetCurrentTaskHandle is used by the priority inheritance mechanism\r
139         within the mutex implementation so must be available if mutexes are used. */\r
140         #undef INCLUDE_xTaskGetCurrentTaskHandle\r
141         #define INCLUDE_xTaskGetCurrentTaskHandle 1\r
142 #else\r
143         #ifndef INCLUDE_xTaskGetCurrentTaskHandle\r
144                 #define INCLUDE_xTaskGetCurrentTaskHandle 0\r
145         #endif\r
146 #endif\r
147 \r
148 #endif /* INC_FREERTOS_H */\r