From 3d2f2081cebee2936d8073ab6a55177b6549013e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 17 Feb 2009 19:58:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@778 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/chconf.h | 216 ++++++++++++++++++++++++--------------- 1 file changed, 131 insertions(+), 85 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index da4744a16..15ce1a80d 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -27,14 +27,25 @@ #ifndef _CHCONF_H_ #define _CHCONF_H_ +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + /** - * If specified then time efficient rather than space efficient code is used - * when two possible implementations exist. - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. + * Frequency of the system timer that drives the system ticks. This also + * defines the system tick time unit. */ -#ifndef CH_OPTIMIZE_SPEED -#define CH_OPTIMIZE_SPEED TRUE +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * This constant is the number of system ticks allowed for the threads before + * preemption occurs. This option is only meaningful if the option + * @p CH_USE_ROUNDROBIN is also active. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 #endif /** @@ -43,10 +54,10 @@ * For performance and code size reasons the recommended setting is to leave * this option disabled.
* You can use this option if you need to merge ChibiOS/RT with external - * libraries that require nested lock/unlock operations. + * libraries that require nested lock/unlock operations. * @note The default is @p FALSE. */ -#ifndef CH_USE_NESTED_LOCKS +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) #define CH_USE_NESTED_LOCKS FALSE #endif @@ -55,15 +66,62 @@ * on threads of equal priority. * @note The default is @p TRUE. */ -#ifndef CH_USE_ROUNDROBIN +#if !defined(CH_USE_ROUNDROBIN) || defined(__DOXYGEN__) #define CH_USE_ROUNDROBIN TRUE #endif +/** + * 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. + */ +#if !defined(CH_HEAP_SIZE) || defined(__DOXYGEN__) +#define CH_HEAP_SIZE 512 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * If specified then time efficient rather than space efficient code is used + * when two possible implementations exist. + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * If enabled 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 usable 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 must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + /** * If specified then the @p chThdWait() function is included in the kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_WAITEXIT +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) #define CH_USE_WAITEXIT TRUE #endif @@ -71,7 +129,7 @@ * If specified then the Semaphores APIs are included in the kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_SEMAPHORES +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) #define CH_USE_SEMAPHORES TRUE #endif @@ -81,7 +139,7 @@ * @note The default is @p FALSE. Enable this if you have special requirements. * @note Requires @p CH_USE_SEMAPHORES. */ -#ifndef CH_USE_SEMAPHORES_PRIORITY +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) #define CH_USE_SEMAPHORES_PRIORITY FALSE #endif @@ -91,7 +149,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_SEMAPHORES. */ -#ifndef CH_USE_SEMSW +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) #define CH_USE_SEMSW TRUE #endif @@ -101,7 +159,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_SEMAPHORES. */ -#ifndef CH_USE_SEMAPHORES_TIMEOUT +#if !defined(CH_USE_SEMAPHORES_TIMEOUT) || defined(__DOXYGEN__) #define CH_USE_SEMAPHORES_TIMEOUT TRUE #endif @@ -109,7 +167,7 @@ * If specified then the Mutexes APIs are included in the kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_MUTEXES +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) #define CH_USE_MUTEXES TRUE #endif @@ -118,7 +176,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_MUTEXES. */ -#ifndef CH_USE_CONDVARS +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) #define CH_USE_CONDVARS TRUE #endif @@ -127,7 +185,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_CONDVARS. */ -#ifndef CH_USE_CONDVARS_TIMEOUT +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) #define CH_USE_CONDVARS_TIMEOUT TRUE #endif @@ -135,7 +193,7 @@ * If specified then the Event flags APIs are included in the kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_EVENTS +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) #define CH_USE_EVENTS TRUE #endif @@ -145,7 +203,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_EVENTS. */ -#ifndef CH_USE_EVENTS_TIMEOUT +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) #define CH_USE_EVENTS_TIMEOUT TRUE #endif @@ -153,7 +211,7 @@ * If specified then the Synchronous Messages APIs are included in the kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_MESSAGES +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) #define CH_USE_MESSAGES TRUE #endif @@ -163,7 +221,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_MESSAGES and @p CH_USE_EVENTS. */ -#ifndef CH_USE_MESSAGES_EVENT +#if !defined(CH_USE_MESSAGES_EVENT) || defined(__DOXYGEN__) #define CH_USE_MESSAGES_EVENT TRUE #endif @@ -172,16 +230,25 @@ * @note The default is @p FALSE. Enable this if you have special requirements. * @note Requires @p CH_USE_MESSAGES. */ -#ifndef CH_USE_MESSAGES_PRIORITY +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) #define CH_USE_MESSAGES_PRIORITY FALSE #endif +/** + * If specified then the Asynchronous Messages (Mailboxes) APIs are included + * in the kernel. + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + /** * If specified then the I/O queues APIs are included in the kernel. * @note The default is @p TRUE. * @note Requires @p CH_USE_SEMAPHORES. */ -#ifndef CH_USE_QUEUES +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE #endif @@ -190,7 +257,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_SEMAPHORES. */ -#ifndef CH_USE_QUEUES_HALFDUPLEX +#if !defined(CH_USE_QUEUES_HALFDUPLEX) || defined(__DOXYGEN__) #define CH_USE_QUEUES_HALFDUPLEX TRUE #endif @@ -200,7 +267,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_QUEUES and @p CH_USE_SEMAPHORES_TIMEOUT. */ -#ifndef CH_USE_QUEUES_TIMEOUT +#if !defined(CH_USE_QUEUES_TIMEOUT) || defined(__DOXYGEN__) #define CH_USE_QUEUES_TIMEOUT TRUE #endif @@ -210,7 +277,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_QUEUES. */ -#ifndef CH_USE_SERIAL_FULLDUPLEX +#if !defined(CH_USE_SERIAL_FULLDUPLEX) || defined(__DOXYGEN__) #define CH_USE_SERIAL_FULLDUPLEX TRUE #endif @@ -220,7 +287,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_QUEUES_HALFDUPLEX. */ -#ifndef CH_USE_SERIAL_HALFDUPLEX +#if !defined(CH_USE_SERIAL_HALFDUPLEX) || defined(__DOXYGEN__) #define CH_USE_SERIAL_HALFDUPLEX TRUE #endif @@ -230,28 +297,17 @@ * @note Requires @p CH_USE_MUTEXES or @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ -#ifndef CH_USE_HEAP +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) #define CH_USE_HEAP TRUE #endif -/** - * 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. - */ -#ifndef CH_HEAP_SIZE -#define CH_HEAP_SIZE 512 -#endif - /** * If enabled enforces the use of the C-runtime @p malloc() and @p free() * functions as backend for the system heap allocator. * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. */ -#ifndef CH_USE_MALLOC_HEAP +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) #define CH_USE_MALLOC_HEAP FALSE #endif @@ -260,7 +316,7 @@ * kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_MEMPOOLS +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) #define CH_USE_MEMPOOLS TRUE #endif @@ -270,52 +326,21 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_WAITEXIT. */ -#ifndef CH_USE_DYNAMIC +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) #define CH_USE_DYNAMIC TRUE #endif -/** - * Frequency of the system timer that drives the system ticks. This also - * defines the system tick time unit. - */ -#ifndef CH_FREQUENCY -#define CH_FREQUENCY 1000 -#endif - -/** - * This constant is the number of system ticks allowed for the threads before - * preemption occurs. This option is only meaningful if the option - * @p CH_USE_ROUNDROBIN is also active. - */ -#ifndef CH_TIME_QUANTUM -#define CH_TIME_QUANTUM 20 -#endif - -/** - * If enabled 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 usable 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 must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ /** * Debug option, if enabled all the assertions in the kernel code are * activated. This includes function parameters checks and consistency - * checks inside the kernel. + * checks inside the kernel. * @note The default is @p FALSE. */ -#ifndef CH_DBG_ENABLE_ASSERTS +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) #define CH_DBG_ENABLE_ASSERTS FALSE #endif @@ -324,22 +349,43 @@ * activated. * @note The default is @p FALSE. */ -#ifndef CH_DBG_ENABLE_TRACE +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) #define CH_DBG_ENABLE_TRACE FALSE #endif +/** + * Debug option, if enabled a runtime stack check is performed. + * @note The stack check is performed in a architecture/port dependent way. It + * may not be implemented at all. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + /** * Debug option, if enabled the threads working area is filled with a byte - * pattern when a thread is created. + * pattern when a thread is created. */ -#ifndef CH_DBG_FILL_THREADS +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) #define CH_DBG_FILL_THREADS FALSE #endif +/** + * Debug option, if enabled a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING FALSE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + /** * User fields added to the end of the @p Thread structure. */ -#ifndef THREAD_EXT_FIELDS +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) #define THREAD_EXT_FIELDS \ struct { \ /* Add thread custom fields here.*/ \ @@ -350,7 +396,7 @@ struct { \ * User initialization code added to the @p chThdInit() API. * @note It is invoked from within @p chThdInit(). */ -#ifndef THREAD_EXT_INIT +#if !defined(THREAD_EXT_INIT) || defined(__DOXYGEN__) #define THREAD_EXT_INIT(tp) { \ /* Add thread initialization code here.*/ \ } @@ -360,7 +406,7 @@ struct { \ * User finalization code added to the @p chThdExit() API. * @note It is inserted into lock zone. */ -#ifndef THREAD_EXT_EXIT +#if !defined(THREAD_EXT_EXIT) || defined(__DOXYGEN__) #define THREAD_EXT_EXIT(tp) { \ /* Add thread finalization code here.*/ \ } @@ -370,7 +416,7 @@ struct { \ * Code inserted inside the idle thread loop immediately after an interrupt * resumed execution. */ -#ifndef IDLE_LOOP_HOOK +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) #define IDLE_LOOP_HOOK() { \ /* Idle loop code here.*/ \ } -- cgit v1.2.3