dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
chconf.h
Go to the documentation of this file.
1 /*
2  ChibiOS/RT - Copyright (C) 2006-2013 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 
32 #ifndef _CHCONF_H_
33 #define _CHCONF_H_
34 
35 /*===========================================================================*/
40 /*===========================================================================*/
41 
47 #if !defined(CH_FREQUENCY) || defined(__DOXYGEN__)
48 #define CH_FREQUENCY 1000
49 #endif
50 
62 #if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__)
63 #define CH_TIME_QUANTUM 1
64 #endif
65 
77 #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__)
78 #define CH_MEMCORE_SIZE 0
79 #endif
80 
94 #if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__)
95 #define CH_NO_IDLE_THREAD FALSE
96 #endif
97 
100 /*===========================================================================*/
105 /*===========================================================================*/
106 
115 #if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__)
116 #define CH_OPTIMIZE_SPEED TRUE
117 #endif
118 
121 /*===========================================================================*/
126 /*===========================================================================*/
127 
134 #if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__)
135 #define CH_USE_REGISTRY TRUE
136 #endif
137 
145 #if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__)
146 #define CH_USE_WAITEXIT TRUE
147 #endif
148 
155 #if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__)
156 #define CH_USE_SEMAPHORES TRUE
157 #endif
158 
167 #if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__)
168 #define CH_USE_SEMAPHORES_PRIORITY FALSE
169 #endif
170 
179 #if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__)
180 #define CH_USE_SEMSW TRUE
181 #endif
182 
189 #if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__)
190 #define CH_USE_MUTEXES TRUE
191 #endif
192 
201 #if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__)
202 #define CH_USE_CONDVARS FALSE
203 #endif
204 
213 #if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__)
214 #define CH_USE_CONDVARS_TIMEOUT FALSE
215 #endif
216 
223 #if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__)
224 #define CH_USE_EVENTS FALSE
225 #endif
226 
235 #if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
236 #define CH_USE_EVENTS_TIMEOUT FALSE
237 #endif
238 
246 #if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__)
247 #define CH_USE_MESSAGES FALSE
248 #endif
249 
258 #if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__)
259 #define CH_USE_MESSAGES_PRIORITY FALSE
260 #endif
261 
270 #if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__)
271 #define CH_USE_MAILBOXES TRUE
272 #endif
273 
280 #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__)
281 #define CH_USE_QUEUES FALSE
282 #endif
283 
291 #if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__)
292 #define CH_USE_MEMCORE FALSE
293 #endif
294 
305 #if !defined(CH_USE_HEAP) || defined(__DOXYGEN__)
306 #define CH_USE_HEAP FALSE
307 #endif
308 
319 #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
320 #define CH_USE_MALLOC_HEAP FALSE
321 #endif
322 
330 #if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__)
331 #define CH_USE_MEMPOOLS TRUE
332 #endif
333 
343 #if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__)
344 #define CH_USE_DYNAMIC FALSE
345 #endif
346 
349 /*===========================================================================*/
354 /*===========================================================================*/
355 
363 #if !defined(CH_DBG_SYSTEM_STATE_CHECK) || defined(__DOXYGEN__)
364 #define CH_DBG_SYSTEM_STATE_CHECK FALSE
365 #endif
366 
374 #if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__)
375 #define CH_DBG_ENABLE_CHECKS FALSE
376 #endif
377 
386 #if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__)
387 #define CH_DBG_ENABLE_ASSERTS FALSE
388 #endif
389 
397 #if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__)
398 #define CH_DBG_ENABLE_TRACE FALSE
399 #endif
400 
411 #if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__)
412 #define CH_DBG_ENABLE_STACK_CHECK FALSE
413 #endif
414 
423 #if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__)
424 #define CH_DBG_FILL_THREADS TRUE
425 #endif
426 
436 #if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
437 #define CH_DBG_THREADS_PROFILING FALSE
438 #endif
439 
442 /*===========================================================================*/
447 /*===========================================================================*/
448 
449 #include <stdint.h>
450 
454 typedef uint32_t halrtcnt_t;
455 
471 #define halGetCounterValue() hal_lld_get_counter_value()
472 
483 #define hal_lld_get_counter_value() DWT_CYCCNT
484 
489 #if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__)
490 #define THREAD_EXT_FIELDS \
491  halrtcnt_t ticks_switched_in; \
492  halrtcnt_t ticks_total; \
493  /* Add threads custom fields here.*/
494 #endif
495 
503 #if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__)
504 #define THREAD_EXT_INIT_HOOK(tp) { \
505  /* Add threads initialization code here.*/ \
506 }
507 #endif
508 
517 #if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__)
518 #define THREAD_EXT_EXIT_HOOK(tp) { \
519  /* Add threads finalization code here.*/ \
520 }
521 #endif
522 
527 #if !defined(THREAD_CONTEXT_SWITCH_HOOK) || defined(__DOXYGEN__)
528 #define THREAD_CONTEXT_SWITCH_HOOK(ntp, otp) { \
529  ntp->ticks_switched_in = halGetCounterValue(); \
530  otp->ticks_total += ntp->ticks_switched_in - otp->ticks_switched_in; \
531  /* System halt code here.*/ \
532 }
533 #endif
534 
539 #if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__)
540 #define IDLE_LOOP_HOOK() { \
541  extern void vApplicationIdleHook(void); \
542  vApplicationIdleHook(); \
543 }
544 #endif
545 
551 #if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__)
552 #define SYSTEM_TICK_EVENT_HOOK() { \
553  /* System tick event code here.*/ \
554 }
555 #endif
556 
562 #if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
563 #define SYSTEM_HALT_HOOK() { \
564  /* System halt code here.*/ \
565 }
566 #endif
567 
570 /*===========================================================================*/
571 /* Port-specific settings (override port settings defaulted in chcore.h). */
572 /*===========================================================================*/
573 
574 /* NOTE: When changing this option you also have to enable or disable the FPU
575  in the project options.*/
576 #define CORTEX_USE_FPU TRUE
577 
578 #endif /* _CHCONF_H_ */
579 
uint32_t halrtcnt_t
Type of the realtime free counter value.
Definition: chconf.h:454