aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/nil/templates
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/nil/templates')
-rw-r--r--lib/chibios/os/nil/templates/chconf.h482
1 files changed, 482 insertions, 0 deletions
diff --git a/lib/chibios/os/nil/templates/chconf.h b/lib/chibios/os/nil/templates/chconf.h
new file mode 100644
index 000000000..20108a4f2
--- /dev/null
+++ b/lib/chibios/os/nil/templates/chconf.h
@@ -0,0 +1,482 @@
1/*
2 ChibiOS - Copyright (C) 2006,2007,2008,2009,2010,2011,2012,2013,2014,
3 2015,2016,2017,2018,2019,2020,2021 Giovanni Di Sirio.
4
5 This file is part of ChibiOS.
6
7 ChibiOS is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation version 3 of the License.
10
11 ChibiOS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20/**
21 * @file nil/templates/chconf.h
22 * @brief Configuration file template.
23 * @details A copy of this file must be placed in each project directory, it
24 * contains the application specific kernel settings.
25 *
26 * @addtogroup NIL_CONFIG
27 * @details Kernel related settings and hooks.
28 * @{
29 */
30
31#ifndef CHCONF_H
32#define CHCONF_H
33
34#define _CHIBIOS_NIL_CONF_
35#define _CHIBIOS_NIL_CONF_VER_4_0_
36
37/*===========================================================================*/
38/**
39 * @name Kernel parameters and options
40 * @{
41 */
42/*===========================================================================*/
43
44/**
45 * @brief Maximum number of user threads in the application.
46 * @note This number is not inclusive of the idle thread which is
47 * implicitly handled.
48 * @note Set this value to be exactly equal to the number of threads you
49 * will use or you would be wasting RAM and cycles.
50 * @note This values also defines the number of available priorities
51 * (0..CH_CFG_MAX_THREADS-1).
52 */
53#if !defined(CH_CFG_MAX_THREADS)
54#define CH_CFG_MAX_THREADS 4
55#endif
56
57/**
58 * @brief Auto starts threads when @p chSysInit() is invoked.
59 */
60#if !defined(CH_CFG_AUTOSTART_THREADS)
61#define CH_CFG_AUTOSTART_THREADS TRUE
62#endif
63
64/** @} */
65
66/*===========================================================================*/
67/**
68 * @name System timer settings
69 * @{
70 */
71/*===========================================================================*/
72
73/**
74 * @brief System time counter resolution.
75 * @note Allowed values are 16 or 32 bits.
76 */
77#if !defined(CH_CFG_ST_RESOLUTION)
78#define CH_CFG_ST_RESOLUTION 32
79#endif
80
81/**
82 * @brief System tick frequency.
83 * @note This value together with the @p CH_CFG_ST_RESOLUTION
84 * option defines the maximum amount of time allowed for
85 * timeouts.
86 */
87#if !defined(CH_CFG_ST_FREQUENCY)
88#define CH_CFG_ST_FREQUENCY 1000
89#endif
90
91/**
92 * @brief Time delta constant for the tick-less mode.
93 * @note If this value is zero then the system uses the classic
94 * periodic tick. This value represents the minimum number
95 * of ticks that is safe to specify in a timeout directive.
96 * The value one is not valid, timeouts are rounded up to
97 * this value.
98 */
99#if !defined(CH_CFG_ST_TIMEDELTA)
100#define CH_CFG_ST_TIMEDELTA 0
101#endif
102
103/** @} */
104
105/*===========================================================================*/
106/**
107 * @name Subsystem options
108 * @{
109 */
110/*===========================================================================*/
111
112/**
113 * @brief Threads synchronization APIs.
114 * @details If enabled then the @p chThdWait() function is included in
115 * the kernel.
116 *
117 * @note The default is @p TRUE.
118 */
119#if !defined(CH_CFG_USE_WAITEXIT)
120#define CH_CFG_USE_WAITEXIT TRUE
121#endif
122
123/**
124 * @brief Semaphores APIs.
125 * @details If enabled then the Semaphores APIs are included in the kernel.
126 *
127 * @note The default is @p TRUE.
128 */
129#if !defined(CH_CFG_USE_SEMAPHORES)
130#define CH_CFG_USE_SEMAPHORES TRUE
131#endif
132
133/**
134 * @brief Mutexes APIs.
135 * @details If enabled then the mutexes APIs are included in the kernel.
136 *
137 * @note Feature not currently implemented.
138 * @note The default is @p FALSE.
139 */
140#if !defined(CH_CFG_USE_MUTEXES)
141#define CH_CFG_USE_MUTEXES FALSE
142#endif
143
144/**
145 * @brief Events Flags APIs.
146 * @details If enabled then the event flags APIs are included in the kernel.
147 *
148 * @note The default is @p TRUE.
149 */
150#if !defined(CH_CFG_USE_EVENTS)
151#define CH_CFG_USE_EVENTS TRUE
152#endif
153
154/**
155 * @brief Synchronous Messages APIs.
156 * @details If enabled then the synchronous messages APIs are included
157 * in the kernel.
158 *
159 * @note The default is @p TRUE.
160 */
161#if !defined(CH_CFG_USE_MESSAGES)
162#define CH_CFG_USE_MESSAGES TRUE
163#endif
164
165/** @} */
166
167/*===========================================================================*/
168/**
169 * @name OSLIB options
170 * @{
171 */
172/*===========================================================================*/
173
174/**
175 * @brief Mailboxes APIs.
176 * @details If enabled then the asynchronous messages (mailboxes) APIs are
177 * included in the kernel.
178 *
179 * @note The default is @p TRUE.
180 * @note Requires @p CH_CFG_USE_SEMAPHORES.
181 */
182#if !defined(CH_CFG_USE_MAILBOXES)
183#define CH_CFG_USE_MAILBOXES TRUE
184#endif
185
186/**
187 * @brief Core Memory Manager APIs.
188 * @details If enabled then the core memory manager APIs are included
189 * in the kernel.
190 *
191 * @note The default is @p TRUE.
192 */
193#if !defined(CH_CFG_USE_MEMCORE)
194#define CH_CFG_USE_MEMCORE TRUE
195#endif
196
197/**
198 * @brief Managed RAM size.
199 * @details Size of the RAM area to be managed by the OS. If set to zero
200 * then the whole available RAM is used. The core memory is made
201 * available to the heap allocator and/or can be used directly through
202 * the simplified core memory allocator.
203 *
204 * @note In order to let the OS manage the whole RAM the linker script must
205 * provide the @p __heap_base__ and @p __heap_end__ symbols.
206 * @note Requires @p CH_CFG_USE_MEMCORE.
207 */
208#if !defined(CH_CFG_MEMCORE_SIZE)
209#define CH_CFG_MEMCORE_SIZE 0
210#endif
211
212/**
213 * @brief Heap Allocator APIs.
214 * @details If enabled then the memory heap allocator APIs are included
215 * in the kernel.
216 *
217 * @note The default is @p TRUE.
218 */
219#if !defined(CH_CFG_USE_HEAP)
220#define CH_CFG_USE_HEAP TRUE
221#endif
222
223/**
224 * @brief Memory Pools Allocator APIs.
225 * @details If enabled then the memory pools allocator APIs are included
226 * in the kernel.
227 *
228 * @note The default is @p TRUE.
229 */
230#if !defined(CH_CFG_USE_MEMPOOLS)
231#define CH_CFG_USE_MEMPOOLS TRUE
232#endif
233
234/**
235 * @brief Objects FIFOs APIs.
236 * @details If enabled then the objects FIFOs APIs are included
237 * in the kernel.
238 *
239 * @note The default is @p TRUE.
240 */
241#if !defined(CH_CFG_USE_OBJ_FIFOS)
242#define CH_CFG_USE_OBJ_FIFOS TRUE
243#endif
244
245/**
246 * @brief Pipes APIs.
247 * @details If enabled then the pipes APIs are included
248 * in the kernel.
249 *
250 * @note The default is @p TRUE.
251 */
252#if !defined(CH_CFG_USE_PIPES)
253#define CH_CFG_USE_PIPES TRUE
254#endif
255
256/**
257 * @brief Objects Caches APIs.
258 * @details If enabled then the objects caches APIs are included
259 * in the kernel.
260 *
261 * @note The default is @p TRUE.
262 */
263#if !defined(CH_CFG_USE_OBJ_CACHES)
264#define CH_CFG_USE_OBJ_CACHES TRUE
265#endif
266
267/**
268 * @brief Delegate threads APIs.
269 * @details If enabled then the delegate threads APIs are included
270 * in the kernel.
271 *
272 * @note The default is @p TRUE.
273 */
274#if !defined(CH_CFG_USE_DELEGATES)
275#define CH_CFG_USE_DELEGATES TRUE
276#endif
277
278/**
279 * @brief Jobs Queues APIs.
280 * @details If enabled then the jobs queues APIs are included
281 * in the kernel.
282 *
283 * @note The default is @p TRUE.
284 */
285#if !defined(CH_CFG_USE_JOBS)
286#define CH_CFG_USE_JOBS TRUE
287#endif
288
289/** @} */
290
291/*===========================================================================*/
292/**
293 * @name Objects factory options
294 * @{
295 */
296/*===========================================================================*/
297
298/**
299 * @brief Objects Factory APIs.
300 * @details If enabled then the objects factory APIs are included in the
301 * kernel.
302 *
303 * @note The default is @p FALSE.
304 */
305#if !defined(CH_CFG_USE_FACTORY)
306#define CH_CFG_USE_FACTORY TRUE
307#endif
308
309/**
310 * @brief Maximum length for object names.
311 * @details If the specified length is zero then the name is stored by
312 * pointer but this could have unintended side effects.
313 */
314#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
315#define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
316#endif
317
318/**
319 * @brief Enables the registry of generic objects.
320 */
321#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
322#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
323#endif
324
325/**
326 * @brief Enables factory for generic buffers.
327 */
328#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
329#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
330#endif
331
332/**
333 * @brief Enables factory for semaphores.
334 */
335#if !defined(CH_CFG_FACTORY_SEMAPHORES)
336#define CH_CFG_FACTORY_SEMAPHORES TRUE
337#endif
338
339/**
340 * @brief Enables factory for mailboxes.
341 */
342#if !defined(CH_CFG_FACTORY_MAILBOXES)
343#define CH_CFG_FACTORY_MAILBOXES TRUE
344#endif
345
346/**
347 * @brief Enables factory for objects FIFOs.
348 */
349#if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
350#define CH_CFG_FACTORY_OBJ_FIFOS TRUE
351#endif
352
353/**
354 * @brief Enables factory for Pipes.
355 */
356#if !defined(CH_CFG_FACTORY_PIPES)
357#define CH_CFG_FACTORY_PIPES TRUE
358#endif
359
360/** @} */
361
362/*===========================================================================*/
363/**
364 * @name Debug options
365 * @{
366 */
367/*===========================================================================*/
368
369/**
370 * @brief Debug option, kernel statistics.
371 *
372 * @note Feature not currently implemented.
373 * @note The default is @p FALSE.
374 */
375#if !defined(CH_DBG_STATISTICS)
376#define CH_DBG_STATISTICS FALSE
377#endif
378
379/**
380 * @brief Debug option, system state check.
381 *
382 * @note The default is @p FALSE.
383 */
384#if !defined(CH_DBG_SYSTEM_STATE_CHECK)
385#define CH_DBG_SYSTEM_STATE_CHECK TRUE
386#endif
387
388/**
389 * @brief Debug option, parameters checks.
390 *
391 * @note The default is @p FALSE.
392 */
393#if !defined(CH_DBG_ENABLE_CHECKS)
394#define CH_DBG_ENABLE_CHECKS TRUE
395#endif
396
397/**
398 * @brief System assertions.
399 *
400 * @note The default is @p FALSE.
401 */
402#if !defined(CH_DBG_ENABLE_ASSERTS)
403#define CH_DBG_ENABLE_ASSERTS TRUE
404#endif
405
406/**
407 * @brief Stack check.
408 *
409 * @note The default is @p FALSE.
410 */
411#if !defined(CH_DBG_ENABLE_STACK_CHECK)
412#define CH_DBG_ENABLE_STACK_CHECK TRUE
413#endif
414
415/** @} */
416
417/*===========================================================================*/
418/**
419 * @name Kernel hooks
420 * @{
421 */
422/*===========================================================================*/
423
424/**
425 * @brief System initialization hook.
426 */
427#define CH_CFG_SYSTEM_INIT_HOOK() { \
428}
429
430/**
431 * @brief Threads descriptor structure extension.
432 * @details User fields added to the end of the @p thread_t structure.
433 */
434#define CH_CFG_THREAD_EXT_FIELDS \
435 /* Add threads custom fields here.*/
436
437/**
438 * @brief Threads initialization hook.
439 */
440#define CH_CFG_THREAD_EXT_INIT_HOOK(tr) { \
441 /* Add custom threads initialization code here.*/ \
442}
443
444/**
445 * @brief Threads finalization hook.
446 * @details User finalization code added to the @p chThdExit() API.
447 */
448#define CH_CFG_THREAD_EXIT_HOOK(tp) {}
449
450/**
451 * @brief Idle thread enter hook.
452 * @note This hook is invoked within a critical zone, no OS functions
453 * should be invoked from here.
454 * @note This macro can be used to activate a power saving mode.
455 */
456#define CH_CFG_IDLE_ENTER_HOOK() { \
457}
458
459/**
460 * @brief Idle thread leave hook.
461 * @note This hook is invoked within a critical zone, no OS functions
462 * should be invoked from here.
463 * @note This macro can be used to deactivate a power saving mode.
464 */
465#define CH_CFG_IDLE_LEAVE_HOOK() { \
466}
467
468/**
469 * @brief System halt hook.
470 */
471#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
472}
473
474/** @} */
475
476/*===========================================================================*/
477/* Port-specific settings (override port settings defaulted in nilcore.h). */
478/*===========================================================================*/
479
480#endif /* CHCONF_H */
481
482/** @} */