]> git.sur5r.net Git - freertos/blob - FreeRTOS/Source/include/projdefs.h
115d35670a3bc0b5fdff8d02f26a47696a0637a1
[freertos] / FreeRTOS / Source / include / projdefs.h
1 /*\r
2     FreeRTOS V8.2.1 - Copyright (C) 2015 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution.\r
8 \r
9     FreeRTOS is free software; you can redistribute it and/or modify it under\r
10     the terms of the GNU General Public License (version 2) as published by the\r
11     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
12 \r
13     ***************************************************************************\r
14     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
15     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
16     >>!   obliged to provide the source code for proprietary components     !<<\r
17     >>!   outside of the FreeRTOS kernel.                                   !<<\r
18     ***************************************************************************\r
19 \r
20     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
21     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
22     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
23     link: http://www.freertos.org/a00114.html\r
24 \r
25     ***************************************************************************\r
26      *                                                                       *\r
27      *    FreeRTOS provides completely free yet professionally developed,    *\r
28      *    robust, strictly quality controlled, supported, and cross          *\r
29      *    platform software that is more than just the market leader, it     *\r
30      *    is the industry's de facto standard.                               *\r
31      *                                                                       *\r
32      *    Help yourself get started quickly while simultaneously helping     *\r
33      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
34      *    tutorial book, reference manual, or both:                          *\r
35      *    http://www.FreeRTOS.org/Documentation                              *\r
36      *                                                                       *\r
37     ***************************************************************************\r
38 \r
39     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
40     the FAQ page "My application does not run, what could be wrong?".  Have you\r
41     defined configASSERT()?\r
42 \r
43     http://www.FreeRTOS.org/support - In return for receiving this top quality\r
44     embedded software for free we request you assist our global community by\r
45     participating in the support forum.\r
46 \r
47     http://www.FreeRTOS.org/training - Investing in training allows your team to\r
48     be as productive as possible as early as possible.  Now you can receive\r
49     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
50     Ltd, and the world's leading authority on the world's leading RTOS.\r
51 \r
52     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
53     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
54     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
55 \r
56     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
57     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
58 \r
59     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
60     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
61     licenses offer ticketed support, indemnification and commercial middleware.\r
62 \r
63     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
64     engineered and independently SIL3 certified version for use in safety and\r
65     mission critical applications that require provable dependability.\r
66 \r
67     1 tab == 4 spaces!\r
68 */\r
69 \r
70 #ifndef PROJDEFS_H\r
71 #define PROJDEFS_H\r
72 \r
73 /*\r
74  * Defines the prototype to which task functions must conform.  Defined in this\r
75  * file to ensure the type is known before portable.h is included.\r
76  */\r
77 typedef void (*TaskFunction_t)( void * );\r
78 \r
79 /* Converts a time in milliseconds to a time in ticks. */\r
80 #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )\r
81 \r
82 #define pdFALSE                 ( ( BaseType_t ) 0 )\r
83 #define pdTRUE                  ( ( BaseType_t ) 1 )\r
84 \r
85 #define pdPASS                  ( pdTRUE )\r
86 #define pdFAIL                  ( pdFALSE )\r
87 #define errQUEUE_EMPTY  ( ( BaseType_t ) 0 )\r
88 #define errQUEUE_FULL   ( ( BaseType_t ) 0 )\r
89 \r
90 /* FreeRTOS error definitions. */\r
91 #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY   ( -1 )\r
92 #define errQUEUE_BLOCKED                                                ( -4 )\r
93 #define errQUEUE_YIELD                                                  ( -5 )\r
94 \r
95 /* Macros used for basic data corruption checks. */\r
96 #ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES\r
97         #define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0\r
98 #endif\r
99 \r
100 #if( configUSE_16_BIT_TICKS == 1 )\r
101         #define pdINTEGRITY_CHECK_VALUE 0x5a5a\r
102 #else\r
103         #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL\r
104 #endif\r
105 \r
106 /* The following errno values are used by FreeRTOS+ components, not FreeRTOS\r
107 itself. */\r
108 #define pdFREERTOS_ERRNO_NONE                   0       /* No errors */\r
109 #define pdFREERTOS_ERRNO_ENOENT                 2       /* No such file or directory */\r
110 #define pdFREERTOS_ERRNO_EIO                    5       /* I/O error */\r
111 #define pdFREERTOS_ERRNO_ENXIO                  6       /* No such device or address */\r
112 #define pdFREERTOS_ERRNO_EBADF                  9       /* Bad file number */\r
113 #define pdFREERTOS_ERRNO_EAGAIN                 11      /* No more processes */\r
114 #define pdFREERTOS_ERRNO_EWOULDBLOCK    11      /* Operation would block */\r
115 #define pdFREERTOS_ERRNO_ENOMEM                 12      /* Not enough memory */\r
116 #define pdFREERTOS_ERRNO_EACCES                 13      /* Permission denied */\r
117 #define pdFREERTOS_ERRNO_EFAULT                 14      /* Bad address */\r
118 #define pdFREERTOS_ERRNO_EBUSY                  16      /* Mount device busy */\r
119 #define pdFREERTOS_ERRNO_EEXIST                 17      /* File exists */\r
120 #define pdFREERTOS_ERRNO_EXDEV                  18      /* Cross-device link */\r
121 #define pdFREERTOS_ERRNO_ENODEV                 19      /* No such device */\r
122 #define pdFREERTOS_ERRNO_ENOTDIR                20      /* Not a directory */\r
123 #define pdFREERTOS_ERRNO_EISDIR                 21      /* Is a directory */\r
124 #define pdFREERTOS_ERRNO_EINVAL                 22      /* Invalid argument */\r
125 #define pdFREERTOS_ERRNO_ENOSPC                 28      /* No space left on device */\r
126 #define pdFREERTOS_ERRNO_ESPIPE                 29      /* Illegal seek */\r
127 #define pdFREERTOS_ERRNO_EROFS                  30      /* Read only file system */\r
128 #define pdFREERTOS_ERRNO_EUNATCH                42      /* Protocol driver not attached */\r
129 #define pdFREERTOS_ERRNO_EBADE                  50      /* Invalid exchange */\r
130 #define pdFREERTOS_ERRNO_EFTYPE                 79      /* Inappropriate file type or format */\r
131 #define pdFREERTOS_ERRNO_ENMFILE                89      /* No more files */\r
132 #define pdFREERTOS_ERRNO_ENOTEMPTY              90      /* Directory not empty */\r
133 #define pdFREERTOS_ERRNO_ENAMETOOLONG   91      /* File or path name too long */\r
134 #define pdFREERTOS_ERRNO_EOPNOTSUPP             95      /* Operation not supported on transport endpoint */\r
135 #define pdFREERTOS_ERRNO_ENOBUFS                105     /* No buffer space available */\r
136 #define pdFREERTOS_ERRNO_ENOPROTOOPT    109     /* Protocol not available */\r
137 #define pdFREERTOS_ERRNO_EADDRINUSE             112     /* Address already in use */\r
138 #define pdFREERTOS_ERRNO_ETIMEDOUT              116     /* Connection timed out */\r
139 #define pdFREERTOS_ERRNO_EINPROGRESS    119     /* Connection already in progress */\r
140 #define pdFREERTOS_ERRNO_EALREADY               120     /* Socket already connected */\r
141 #define pdFREERTOS_ERRNO_EADDRNOTAVAIL  125     /* Address not available */\r
142 #define pdFREERTOS_ERRNO_EISCONN                127     /* Socket is already connected */\r
143 #define pdFREERTOS_ERRNO_ENOTCONN               128     /* Socket is not connected */\r
144 #define pdFREERTOS_ERRNO_ENOMEDIUM              135     /* No medium inserted */\r
145 #define pdFREERTOS_ERRNO_EILSEQ                 138     /* An invalid UTF-16 sequence was encountered. */\r
146 #define pdFREERTOS_ERRNO_ECANCELED              140     /* Operation canceled. */\r
147 \r
148 /* The following endian values are used by FreeRTOS+ components, not FreeRTOS\r
149 itself. */\r
150 #define pdFREERTOS_LITTLE_ENDIAN        0\r
151 #define pdFREERTOS_BIG_ENDIAN           1\r
152 \r
153 #endif /* PROJDEFS_H */\r
154 \r
155 \r
156 \r