blob: 7a444aa2dabcd3af4b73eea67b53f2ca59453261 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
/*
ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @addtogroup Config
* @{
*/
#ifndef _CHCONF_H_
#define _CHCONF_H_
/** Configuration option: if specified then time efficient rather than space
* efficient code is used when two possible implementations exist, note
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the \p chThdWait() function
* is included in the kernel.*/
#define CH_USE_WAITEXIT
/** Configuration option: if specified then the Semaphores APIs are included
* in the kernel.*/
#define CH_USE_SEMAPHORES
/** Configuration option: if specified then the Semaphores atomic Signal+Wait
* APIs are included in the kernel.*/
#define CH_USE_SEMSW
/** Configuration option: if specified then the Semaphores with timeout APIs
* are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.*/
#define CH_USE_SEMAPHORES_TIMEOUT
/** Configuration option: if specified then the Mutexes APIs are included in
* the kernel.*/
#define CH_USE_MUTEXES
/** Configuration option: if specified then the Events APIs are included in
* the kernel.*/
#define CH_USE_EVENTS
/** Configuration option: if specified then the \p chEvtWaitXXXTimeout()
* functions are included in the kernel.
* @note requires \p CH_USE_EVENTS.
*/
#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
* included in the kernel.*/
#define CH_USE_MESSAGES
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.*/
#define CH_USE_MESSAGES_EVENT
/** Configuration option: If enabled then the threads have an option to serve
* messages by priority instead of FIFO order.
* @note requires \p CH_USE_MESSAGES.*/
//#define CH_USE_MESSAGES_PRIORITY
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be
* removed in version 1.0.0.
*/
#define CH_USE_EXIT_EVENT
/** Configuration option: if specified then the I/O queues APIs are included
* in the kernel.*/
#define CH_USE_QUEUES
/** Configuration option: if specified then the halfduplex queue APIs are
* included in the kernel.*/
#define CH_USE_QUEUES_HALFDUPLEX
/** Configuration option: if specified then the I/O queues with timeout
* APIs are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES_TIMEOUT.*/
#define CH_USE_QUEUES_TIMEOUT
/** Configuration option: if specified then the full duplex serial driver APIs
* are included in the kernel.*/
#define CH_USE_SERIAL_FULLDUPLEX
/** Configuration option: if specified then the half duplex serial driver APIs
* are included in the kernel.*/
#define CH_USE_SERIAL_HALFDUPLEX
/** Configuration option: if specified then the memory heap allocator APIs
* are included in the kernel.*/
#define CH_USE_HEAP
/** Configuration option: Number of RAM bytes to use as system heap. If set to
* zero then the whole available RAM is used as system heap.
* @note In order to use the whole RAM as system heap the linker script must
* provide the \p __heap_base__ and \p __heap_end__ symbols.
* @note requires \p CH_USE_HEAP.
*/
#define CH_HEAP_SIZE 16384
/** Configuration option: enforces the use of the C-runtime \p malloc() and
* \p free() functions as backend for the system heap allocator.*/
//#define CH_USE_MALLOC_HEAP
/** Configuration option: if specified then the memory pools allocator APIs
* are included in the kernel.*/
#define CH_USE_MEMPOOLS
/** Configuration option: if specified then the dynamic objects creation APIs
* are included in the kernel.
* @note requires \p CH_USE_WAITEXIT.
*/
#define CH_USE_DYNAMIC
/** Configuration option: Frequency of the system timer that drives the system
* ticks. This also defines the system time unit.*/
#define CH_FREQUENCY 1000
/** Configuration option: This constant is the number of ticks allowed for the
* threads before preemption occurs. This option is only meaningful if the
* option \p CH_USE_ROUNDROBIN is also active.*/
#define CH_TIME_QUANTUM 20
/** Configuration option: Defines a CPU register to be used as storage for the
* global \p currp variable. Caching this variable in a register can greatly
* improve both space and time efficiency of the generated code. Another side
* effect is that one less register has to be saved during the context switch
* resulting in lower RAM usage and faster code.
* @note This option is only useable with the GCC compiler and is only useful
* on processors with many registers like ARM cores.
* @note If this option is enabled then ALL the libraries linked to the
* ChibiOS/RT code <b>must</b> be recompiled with the GCC option \p
* -ffixed-\<reg\>.
*/
//#define CH_CURRP_REGISTER_CACHE "reg"
/** Configuration option: Includes basic debug support to the kernel.
* @note the debug support is port-dependent, it may be not present on some
* targets. In that case stub functions will be included.
*/
//#define CH_USE_DEBUG
/** Debug option: Includes the threads context switch tracing feature.
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure. */
#define THREAD_EXT_FIELDS \
struct { \
/* Add thread custom fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API.
* @note It is invoked from within \p chThdInit(). */
#define THREAD_EXT_INIT(tp) { \
/* Add thread initialization code here.*/ \
}
/** User finalization code added to the \p chThdExit() API.
* @note It is inserted into lock zone. */
#define THREAD_EXT_EXIT(tp) { \
/* Add thread finalization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */
|