Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
chconf.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
28 #ifndef CHCONF_H
29 #define CHCONF_H
30 
31 #define _CHIBIOS_RT_CONF_
32 #define _CHIBIOS_RT_CONF_VER_5_1_
33 
34 /*===========================================================================*/
39 /*===========================================================================*/
40 
45 #define CH_CFG_ST_RESOLUTION 32
46 
52 #define CH_CFG_ST_FREQUENCY 10000
53 
58 #define CH_CFG_INTERVALS_SIZE 32
59 
64 #define CH_CFG_TIME_TYPES_SIZE 32
65 
66 
75 #define CH_CFG_ST_TIMEDELTA 0
76 
79 /*===========================================================================*/
84 /*===========================================================================*/
85 
98 #define CH_CFG_TIME_QUANTUM 10
99 
111 #define CH_CFG_MEMCORE_SIZE 0
112 
120 #define CH_CFG_NO_IDLE_THREAD FALSE
121 
124 /*===========================================================================*/
129 /*===========================================================================*/
130 
139 #define CH_CFG_OPTIMIZE_SPEED TRUE
140 
143 /*===========================================================================*/
148 /*===========================================================================*/
149 
157 #define CH_CFG_USE_TM TRUE
158 
165 #define CH_CFG_USE_REGISTRY TRUE
166 
174 #define CH_CFG_USE_WAITEXIT TRUE
175 
182 #define CH_CFG_USE_SEMAPHORES TRUE
183 
193 #define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
194 
201 #define CH_CFG_USE_MUTEXES TRUE
202 
211 #define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
212 
221 #define CH_CFG_USE_CONDVARS TRUE
222 
231 #define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
232 
239 #define CH_CFG_USE_EVENTS TRUE
240 
249 #define CH_CFG_USE_EVENTS_TIMEOUT TRUE
250 
258 #define CH_CFG_USE_MESSAGES TRUE
259 
269 #define CH_CFG_USE_MESSAGES_PRIORITY FALSE
270 
279 #define CH_CFG_USE_MAILBOXES TRUE
280 
288 #define CH_CFG_USE_MEMCORE TRUE
289 
300 #define CH_CFG_USE_HEAP TRUE
301 
309 #define CH_CFG_USE_MEMPOOLS TRUE
310 
318 #define CH_CFG_USE_OBJ_FIFOS TRUE
319 
329 #define CH_CFG_USE_DYNAMIC TRUE
330 
333 /*===========================================================================*/
338 /*===========================================================================*/
339 
347 #define CH_CFG_USE_FACTORY TRUE
348 
354 #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
355 
359 #define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
360 
364 #define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
365 
369 #define CH_CFG_FACTORY_SEMAPHORES TRUE
370 
374 #define CH_CFG_FACTORY_MAILBOXES TRUE
375 
379 #define CH_CFG_FACTORY_OBJ_FIFOS TRUE
380 
383 /*===========================================================================*/
388 /*===========================================================================*/
389 
395 #if !defined(CH_DBG_STATISTICS)
396 #define CH_DBG_STATISTICS FALSE
397 #endif
398 
406 #if !defined(CH_DBG_SYSTEM_STATE_CHECK)
407 #define CH_DBG_SYSTEM_STATE_CHECK FALSE
408 #endif
409 
417 #if !defined(CH_DBG_ENABLE_CHECKS)
418 #define CH_DBG_ENABLE_CHECKS FALSE
419 #endif
420 
429 #if !defined(CH_DBG_ENABLE_ASSERTS)
430 #define CH_DBG_ENABLE_ASSERTS FALSE
431 #endif
432 
439 #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
440 
446 #define CH_DBG_TRACE_BUFFER_SIZE 128
447 
458 #if !defined(CH_DBG_ENABLE_STACK_CHECK)
459 #define CH_DBG_ENABLE_STACK_CHECK FALSE
460 #endif
461 
470 #if !defined(CH_DBG_FILL_THREADS)
471 #define CH_DBG_FILL_THREADS FALSE
472 #endif
473 
483 #if !defined(CH_DBG_THREADS_PROFILING)
484 #define CH_DBG_THREADS_PROFILING FALSE
485 #endif
486 
489 /*===========================================================================*/
494 /*===========================================================================*/
495 
500 #define CH_CFG_SYSTEM_EXTRA_FIELDS \
501  /* Add threads custom fields here.*/
502 
508 #define CH_CFG_SYSTEM_INIT_HOOK(tp) { \
509  /* Add threads initialization code here.*/ \
510 }
511 
516 #define CH_CFG_THREAD_EXTRA_FIELDS \
517  /* Add threads custom fields here.*/
518 
526 #define CH_CFG_THREAD_INIT_HOOK(tp) { \
527  /* Add threads initialization code here.*/ \
528 }
529 
534 #define CH_CFG_THREAD_EXIT_HOOK(tp) { \
535  /* Add threads finalization code here.*/ \
536 }
537 
542 #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
543  /* Context switch code here.*/ \
544 }
545 
549 #define CH_CFG_IRQ_PROLOGUE_HOOK() { \
550  /* IRQ prologue code here.*/ \
551 }
552 
556 #define CH_CFG_IRQ_EPILOGUE_HOOK() { \
557  /* IRQ epilogue code here.*/ \
558 }
559 
566 #define CH_CFG_IDLE_ENTER_HOOK() { \
567  /* Idle-enter code here.*/ \
568 }
569 
576 #define CH_CFG_IDLE_LEAVE_HOOK() { \
577  /* Idle-leave code here.*/ \
578 }
579 
584 #define CH_CFG_IDLE_LOOP_HOOK() { \
585  /* Idle loop code here.*/ \
586 }
587 
593 #define CH_CFG_SYSTEM_TICK_HOOK() { \
594  /* System tick event code here.*/ \
595 }
596 
602 #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
603  /* System halt code here.*/ \
604 }
605 
611 #define CH_CFG_TRACE_HOOK(tep) { \
612  /* Trace code here.*/ \
613 }
614 
617 /*===========================================================================*/
618 /* Port-specific settings (override port settings defaulted in chcore.h). */
619 /*===========================================================================*/
620 
621 
622 
623 #ifndef CORTEX_VTOR_INIT // try to find the correct init address if not defined
624 
625 #if USE_ITCM // point to correct interrupt vector when using ITCM flash on F7
626 #define CORTEX_VTOR_INIT 0x00200000U
627 
628 #elif LUFTBOOT // using LUFTBOOT bootloader
629 #if defined STM32F4
630 #define CORTEX_VTOR_INIT 0x00004000U
631 #else
632 #define CORTEX_VTOR_INIT 0x00002000U
633 #endif
634 
635 #else // default value
636 #define CORTEX_VTOR_INIT 0x08000000U
637 #endif
638 
639 #endif // CORTEX_VTOR_INIT
640 
641 // allow float for the ChibiOS print function (used with logger)
642 #define CHPRINTF_USE_FLOAT 1
643 
644 #endif /* _CHCONF_H_ */
645