Renamed or added prefix to all hernel configuration options.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6010 35acf78f-673a-0410-8e92-d51de3d6d3f4master
parent
dc7b36df31
commit
49d71a01ab
|
@ -40,8 +40,20 @@
|
|||
* @details Frequency of the system timer that drives the system ticks. This
|
||||
* setting also defines the system tick time unit.
|
||||
*/
|
||||
#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__)
|
||||
#define CH_FREQUENCY 1000
|
||||
#if !defined(CH_CFG_FREQUENCY) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_FREQUENCY 1000
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Time delta constant for the tick-less mode.
|
||||
* @note If this value is zero then the system uses the classic
|
||||
* periodic tick. This value represents the minimum number
|
||||
* of ticks that is safe to specify in a timeout directive.
|
||||
* The value one is not valid, timeouts are rounded up to
|
||||
* this value.
|
||||
*/
|
||||
#if !defined(CH_CFG_TIMEDELTA) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_TIMEDELTA 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -51,12 +63,13 @@
|
|||
* disables the preemption for threads with equal priority and the
|
||||
* round robin becomes cooperative. Note that higher priority
|
||||
* threads can still preempt, the kernel is always preemptive.
|
||||
*
|
||||
* @note Disabling the round robin preemption makes the kernel more compact
|
||||
* and generally faster.
|
||||
* @note The round robin preemption is not supported in tickless mode and
|
||||
* must be set to zero in that case.
|
||||
*/
|
||||
#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__)
|
||||
#define CH_TIME_QUANTUM 20
|
||||
#if !defined(CH_CFG_TIME_QUANTUM) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_TIME_QUANTUM 20
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -68,10 +81,10 @@
|
|||
*
|
||||
* @note In order to let the OS manage the whole RAM the linker script must
|
||||
* provide the @p __heap_base__ and @p __heap_end__ symbols.
|
||||
* @note Requires @p CH_USE_MEMCORE.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE.
|
||||
*/
|
||||
#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__)
|
||||
#define CH_MEMCORE_SIZE 0
|
||||
#if !defined(CH_CFG_MEMCORE_SIZE) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_MEMCORE_SIZE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -87,8 +100,8 @@
|
|||
* @note Unless an idle thread is spawned the @p main() thread must not
|
||||
* enter a sleep state.
|
||||
*/
|
||||
#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__)
|
||||
#define CH_NO_IDLE_THREAD FALSE
|
||||
#if !defined(CH_CFG_NO_IDLE_THREAD) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_NO_IDLE_THREAD FALSE
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
@ -108,8 +121,8 @@
|
|||
* @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
|
||||
#if !defined(CH_CFG_OPTIMIZE_SPEED) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_OPTIMIZE_SPEED TRUE
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
@ -127,8 +140,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__)
|
||||
#define CH_USE_REGISTRY TRUE
|
||||
#if !defined(CH_CFG_USE_REGISTRY) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_REGISTRY TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -138,8 +151,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__)
|
||||
#define CH_USE_WAITEXIT TRUE
|
||||
#if !defined(CH_CFG_USE_WAITEXIT) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_WAITEXIT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -148,8 +161,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__)
|
||||
#define CH_USE_SEMAPHORES TRUE
|
||||
#if !defined(CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_SEMAPHORES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -157,23 +170,12 @@
|
|||
* @details If enabled then the threads are enqueued on semaphores by
|
||||
* priority rather than in FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special requirements.
|
||||
* @note Requires @p CH_USE_SEMAPHORES.
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__)
|
||||
#define CH_USE_SEMAPHORES_PRIORITY FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Atomic semaphore API.
|
||||
* @details If enabled then the semaphores the @p chSemSignalWait() API
|
||||
* is included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_SEMAPHORES.
|
||||
*/
|
||||
#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__)
|
||||
#define CH_USE_SEMSW TRUE
|
||||
#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -182,8 +184,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MUTEXES TRUE
|
||||
#if !defined(CH_CFG_USE_MUTEXES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MUTEXES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -192,10 +194,10 @@
|
|||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_MUTEXES.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__)
|
||||
#define CH_USE_CONDVARS TRUE
|
||||
#if !defined(CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_CONDVARS TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -204,10 +206,10 @@
|
|||
* specification are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_CONDVARS.
|
||||
* @note Requires @p CH_CFG_USE_CONDVARS.
|
||||
*/
|
||||
#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__)
|
||||
#define CH_USE_CONDVARS_TIMEOUT TRUE
|
||||
#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -216,8 +218,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__)
|
||||
#define CH_USE_EVENTS TRUE
|
||||
#if !defined(CH_CFG_USE_EVENTS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_EVENTS TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -226,10 +228,10 @@
|
|||
* are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_EVENTS.
|
||||
* @note Requires @p CH_CFG_USE_EVENTS.
|
||||
*/
|
||||
#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
|
||||
#define CH_USE_EVENTS_TIMEOUT TRUE
|
||||
#if !defined(CH_CFG_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -239,8 +241,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MESSAGES TRUE
|
||||
#if !defined(CH_CFG_USE_MESSAGES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MESSAGES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -248,11 +250,12 @@
|
|||
* @details If enabled then messages are served by priority rather than in
|
||||
* FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special requirements.
|
||||
* @note Requires @p CH_USE_MESSAGES.
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_MESSAGES.
|
||||
*/
|
||||
#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MESSAGES_PRIORITY FALSE
|
||||
#if !defined(CH_CFG_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -261,10 +264,10 @@
|
|||
* included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_SEMAPHORES.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MAILBOXES TRUE
|
||||
#if !defined(CH_CFG_USE_MAILBOXES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MAILBOXES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -273,8 +276,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__)
|
||||
#define CH_USE_QUEUES TRUE
|
||||
#if !defined(CH_CFG_USE_QUEUES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_QUEUES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -284,8 +287,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MEMCORE TRUE
|
||||
#if !defined(CH_CFG_USE_MEMCORE) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MEMCORE TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -294,12 +297,12 @@
|
|||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or
|
||||
* @p CH_USE_SEMAPHORES.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
|
||||
* @p CH_CFG_USE_SEMAPHORES.
|
||||
* @note Mutexes are recommended.
|
||||
*/
|
||||
#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__)
|
||||
#define CH_USE_HEAP TRUE
|
||||
#if !defined(CH_CFG_USE_HEAP) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_HEAP TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -309,8 +312,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MEMPOOLS TRUE
|
||||
#if !defined(CH_CFG_USE_MEMPOOLS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MEMPOOLS TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -319,11 +322,11 @@
|
|||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_WAITEXIT.
|
||||
* @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS.
|
||||
* @note Requires @p CH_CFG_USE_WAITEXIT.
|
||||
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
|
||||
*/
|
||||
#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__)
|
||||
#define CH_USE_DYNAMIC TRUE
|
||||
#if !defined(CH_CFG_USE_DYNAMIC) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_DYNAMIC TRUE
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
@ -343,7 +346,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_SYSTEM_STATE_CHECK) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -354,7 +357,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_CHECKS FALSE
|
||||
#define CH_DBG_ENABLE_CHECKS FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -366,7 +369,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_ASSERTS FALSE
|
||||
#define CH_DBG_ENABLE_ASSERTS FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -377,7 +380,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_TRACE FALSE
|
||||
#define CH_DBG_ENABLE_TRACE FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -391,7 +394,7 @@
|
|||
* @p panic_msg variable set to @p NULL.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||||
#define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -403,7 +406,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_FILL_THREADS FALSE
|
||||
#define CH_DBG_FILL_THREADS FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -416,7 +419,7 @@
|
|||
* some test cases into the test suite.
|
||||
*/
|
||||
#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_THREADS_PROFILING TRUE
|
||||
#define CH_DBG_THREADS_PROFILING TRUE
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
@ -432,8 +435,8 @@
|
|||
* @brief Threads descriptor structure extension.
|
||||
* @details User fields added to the end of the @p thread_t structure.
|
||||
*/
|
||||
#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__)
|
||||
#define THREAD_EXT_FIELDS \
|
||||
#if !defined(CH_CFG_THREAD_EXTRA_FIELDS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_THREAD_EXTRA_FIELDS \
|
||||
/* Add threads custom fields here.*/
|
||||
#endif
|
||||
|
||||
|
@ -444,8 +447,8 @@
|
|||
* @note It is invoked from within @p chThdInit() and implicitly from all
|
||||
* the threads creation APIs.
|
||||
*/
|
||||
#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__)
|
||||
#define THREAD_EXT_INIT_HOOK(tp) { \
|
||||
#if !defined(CH_CFG_THREAD_INIT_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_THREAD_INIT_HOOK(tp) { \
|
||||
/* Add threads initialization code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
@ -458,8 +461,8 @@
|
|||
* @note It is also invoked when the threads simply return in order to
|
||||
* terminate.
|
||||
*/
|
||||
#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__)
|
||||
#define THREAD_EXT_EXIT_HOOK(tp) { \
|
||||
#if !defined(CH_CFG_THREAD_EXIT_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
|
||||
/* Add threads finalization code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
@ -468,8 +471,8 @@
|
|||
* @brief Context switch hook.
|
||||
* @details This hook is invoked just before switching between threads.
|
||||
*/
|
||||
#if !defined(THREAD_CONTEXT_SWITCH_HOOK) || defined(__DOXYGEN__)
|
||||
#define THREAD_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
||||
#if !defined(CH_CFG_CONTEXT_SWITCH_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
||||
/* System halt code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
@ -478,8 +481,8 @@
|
|||
* @brief Idle Loop hook.
|
||||
* @details This hook is continuously invoked by the idle thread loop.
|
||||
*/
|
||||
#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__)
|
||||
#define IDLE_LOOP_HOOK() { \
|
||||
#if !defined(CH_CFG_IDLE_LOOP_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_IDLE_LOOP_HOOK() { \
|
||||
/* Idle loop code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
@ -489,8 +492,8 @@
|
|||
* @details This hook is invoked in the system tick handler immediately
|
||||
* after processing the virtual timers queue.
|
||||
*/
|
||||
#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__)
|
||||
#define SYSTEM_TICK_EVENT_HOOK() { \
|
||||
#if !defined(CH_CFG_SYSTEM_TICK_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_SYSTEM_TICK_HOOK() { \
|
||||
/* System tick event code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
@ -500,8 +503,8 @@
|
|||
* @details This hook is invoked in case to a system halting error before
|
||||
* the system is halted.
|
||||
*/
|
||||
#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
|
||||
#define SYSTEM_HALT_HOOK() { \
|
||||
#if !defined(CH_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_SYSTEM_HALT_HOOK() { \
|
||||
/* System halt code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if ADC_USE_MUTUAL_EXCLUSION && !CH_USE_MUTEXES && !CH_USE_SEMAPHORES
|
||||
#error "ADC_USE_MUTUAL_EXCLUSION requires CH_USE_MUTEXES and/or CH_USE_SEMAPHORES"
|
||||
#if ADC_USE_MUTUAL_EXCLUSION && !CH_CFG_USE_MUTEXES && !CH_CFG_USE_SEMAPHORES
|
||||
#error "ADC_USE_MUTUAL_EXCLUSION requires CH_CFG_USE_MUTEXES and/or CH_CFG_USE_SEMAPHORES"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -89,8 +89,8 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !CH_USE_SEMAPHORES || !CH_USE_EVENTS
|
||||
#error "CAN driver requires CH_USE_SEMAPHORES and CH_USE_EVENTS"
|
||||
#if !CH_CFG_USE_SEMAPHORES || !CH_CFG_USE_EVENTS
|
||||
#error "CAN driver requires CH_CFG_USE_SEMAPHORES and CH_CFG_USE_EVENTS"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -69,8 +69,8 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if I2C_USE_MUTUAL_EXCLUSION && !CH_USE_MUTEXES && !CH_USE_SEMAPHORES
|
||||
#error "I2C_USE_MUTUAL_EXCLUSION requires CH_USE_MUTEXES and/or CH_USE_SEMAPHORES"
|
||||
#if I2C_USE_MUTUAL_EXCLUSION && !CH_CFG_USE_MUTEXES && !CH_CFG_USE_SEMAPHORES
|
||||
#error "I2C_USE_MUTUAL_EXCLUSION requires CH_CFG_USE_MUTEXES and/or CH_CFG_USE_SEMAPHORES"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -199,7 +199,7 @@ typedef struct {
|
|||
#define chnReadTimeout(ip, bp, n, time) ((ip)->vmt->readt(ip, bp, n, time))
|
||||
/** @} */
|
||||
|
||||
#if CH_USE_EVENTS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @name I/O status flags added to the event listener
|
||||
* @{
|
||||
|
@ -287,7 +287,7 @@ typedef struct {
|
|||
}
|
||||
/** @} */
|
||||
|
||||
#endif /* CH_USE_EVENTS */
|
||||
#endif /* CH_CFG_USE_EVENTS */
|
||||
|
||||
#endif /* _IO_CHANNEL_H_ */
|
||||
|
||||
|
|
|
@ -61,12 +61,12 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !CH_USE_SEMAPHORES || !CH_USE_EVENTS
|
||||
#error "the MAC driver requires CH_USE_SEMAPHORES"
|
||||
#if !CH_CFG_USE_SEMAPHORES || !CH_CFG_USE_EVENTS
|
||||
#error "the MAC driver requires CH_CFG_USE_SEMAPHORES"
|
||||
#endif
|
||||
|
||||
#if MAC_USE_EVENTS && !CH_USE_EVENTS
|
||||
#error "the MAC driver requires CH_USE_EVENTS"
|
||||
#if MAC_USE_EVENTS && !CH_CFG_USE_EVENTS
|
||||
#error "the MAC driver requires CH_CFG_USE_EVENTS"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -65,8 +65,8 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !HAL_USE_SPI || !SPI_USE_WAIT || !CH_USE_EVENTS
|
||||
#error "MMC_SPI driver requires HAL_USE_SPI, SPI_USE_WAIT and CH_USE_EVENTS"
|
||||
#if !HAL_USE_SPI || !SPI_USE_WAIT || !CH_CFG_USE_EVENTS
|
||||
#error "MMC_SPI driver requires HAL_USE_SPI, SPI_USE_WAIT and CH_CFG_USE_EVENTS"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -79,8 +79,8 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !CH_USE_QUEUES && !CH_USE_EVENTS
|
||||
#error "Serial Driver requires CH_USE_QUEUES and CH_USE_EVENTS"
|
||||
#if !CH_CFG_USE_QUEUES && !CH_CFG_USE_EVENTS
|
||||
#error "Serial Driver requires CH_CFG_USE_QUEUES and CH_CFG_USE_EVENTS"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -99,9 +99,9 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !HAL_USE_USB || !CH_USE_QUEUES || !CH_USE_EVENTS
|
||||
#error "Serial over USB Driver requires HAL_USE_USB, CH_USE_QUEUES, "
|
||||
"CH_USE_EVENTS"
|
||||
#if !HAL_USE_USB || !CH_CFG_USE_QUEUES || !CH_CFG_USE_EVENTS
|
||||
#error "Serial over USB Driver requires HAL_USE_USB, CH_CFG_USE_QUEUES, "
|
||||
"CH_CFG_USE_EVENTS"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if SPI_USE_MUTUAL_EXCLUSION && !CH_USE_MUTEXES && !CH_USE_SEMAPHORES
|
||||
#error "SPI_USE_MUTUAL_EXCLUSION requires CH_USE_MUTEXES and/or CH_USE_SEMAPHORES"
|
||||
#if SPI_USE_MUTUAL_EXCLUSION && !CH_CFG_USE_MUTEXES && !CH_CFG_USE_SEMAPHORES
|
||||
#error "SPI_USE_MUTUAL_EXCLUSION requires CH_CFG_USE_MUTEXES and/or CH_CFG_USE_SEMAPHORES"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -257,12 +257,12 @@ struct ADCDriver {
|
|||
Thread *thread;
|
||||
#endif
|
||||
#if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the peripheral.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* ADC_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -137,12 +137,12 @@ struct I2CDriver{
|
|||
*/
|
||||
size_t txbytes;
|
||||
#if I2C_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* I2C_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -159,12 +159,12 @@ struct SPIDriver {
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -125,12 +125,12 @@ struct I2CDriver {
|
|||
*/
|
||||
i2cflags_t errors;
|
||||
#if I2C_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* I2C_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -54,7 +54,7 @@ void hal_lld_init(void) {
|
|||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
nvicSetSystemHandlerPriority(HANDLER_SYSTICK, CORTEX_PRIORITY_SYSTICK);
|
||||
SysTick->LOAD = LPC_SYSCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = LPC_SYSCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -235,12 +235,12 @@ struct SPIDriver {
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -59,7 +59,7 @@ void hal_lld_init(void) {
|
|||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
nvicSetSystemHandlerPriority(HANDLER_SYSTICK, CORTEX_PRIORITY_SYSTICK);
|
||||
SysTick->LOAD = LPC11xx_SYSCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = LPC11xx_SYSCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -138,12 +138,12 @@ struct I2CDriver {
|
|||
*/
|
||||
i2cflags_t errors;
|
||||
#if I2C_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* I2C_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -263,12 +263,12 @@ struct SPIDriver {
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -54,7 +54,7 @@ void hal_lld_init(void) {
|
|||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
nvicSetSystemHandlerPriority(HANDLER_SYSTICK, CORTEX_PRIORITY_SYSTICK);
|
||||
SysTick->LOAD = LPC122x_SYSCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = LPC122x_SYSCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -138,12 +138,12 @@ struct I2CDriver {
|
|||
*/
|
||||
i2cflags_t errors;
|
||||
#if I2C_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* I2C_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -209,12 +209,12 @@ struct SPIDriver {
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -59,7 +59,7 @@ void hal_lld_init(void) {
|
|||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
nvicSetSystemHandlerPriority(HANDLER_SYSTICK, CORTEX_PRIORITY_SYSTICK);
|
||||
SysTick->LOAD = LPC13xx_SYSCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = LPC13xx_SYSCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -263,12 +263,12 @@ struct SPIDriver {
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -135,12 +135,12 @@ struct SPIDriver {
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -54,7 +54,7 @@ void hal_lld_init(void) {
|
|||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
nvicSetSystemHandlerPriority(HANDLER_SYSTICK, CORTEX_PRIORITY_SYSTICK);
|
||||
SysTick->LOAD = LPC8xx_SYSCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = LPC8xx_SYSCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -209,12 +209,12 @@ struct SPIDriver {
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
/*===========================================================================*/
|
||||
|
||||
static struct timeval nextcnt;
|
||||
static struct timeval tick = {0, 1000000 / CH_FREQUENCY};
|
||||
static struct timeval tick = {0, 1000000 / CH_CFG_FREQUENCY};
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver local functions. */
|
||||
|
|
|
@ -90,7 +90,7 @@ void hal_lld_init(void) {
|
|||
INTC.PSR[59].R = SPC5_PIT0_IRQ_PRIORITY;
|
||||
halSPCSetPeripheralClockMode(92,
|
||||
SPC5_ME_PCTL_RUN(2) | SPC5_ME_PCTL_LP(2));
|
||||
reg = halSPCGetSystemClock() / CH_FREQUENCY - 1;
|
||||
reg = halSPCGetSystemClock() / CH_CFG_FREQUENCY - 1;
|
||||
PIT.PITMCR.R = 1; /* PIT clock enabled, stop while debugging. */
|
||||
PIT.CH[0].LDVAL.R = reg;
|
||||
PIT.CH[0].CVAL.R = reg;
|
||||
|
|
|
@ -90,7 +90,7 @@ void hal_lld_init(void) {
|
|||
INTC.PSR[59].R = SPC5_PIT0_IRQ_PRIORITY;
|
||||
halSPCSetPeripheralClockMode(92,
|
||||
SPC5_ME_PCTL_RUN(2) | SPC5_ME_PCTL_LP(2));
|
||||
reg = halSPCGetSystemClock() / CH_FREQUENCY - 1;
|
||||
reg = halSPCGetSystemClock() / CH_CFG_FREQUENCY - 1;
|
||||
PIT.PITMCR.R = 1; /* PIT clock enabled, stop while debugging. */
|
||||
PIT.CH[0].LDVAL.R = reg;
|
||||
PIT.CH[0].CVAL.R = reg;
|
||||
|
|
|
@ -90,7 +90,7 @@ void hal_lld_init(void) {
|
|||
INTC.PSR[59].R = SPC5_PIT0_IRQ_PRIORITY;
|
||||
halSPCSetPeripheralClockMode(92,
|
||||
SPC5_ME_PCTL_RUN(2) | SPC5_ME_PCTL_LP(2));
|
||||
reg = halSPCGetSystemClock() / CH_FREQUENCY - 1;
|
||||
reg = halSPCGetSystemClock() / CH_CFG_FREQUENCY - 1;
|
||||
PIT.PITMCR.R = 1; /* PIT clock enabled, stop while debugging. */
|
||||
PIT.CH[0].LDVAL.R = reg;
|
||||
PIT.CH[0].CVAL.R = reg;
|
||||
|
|
|
@ -77,7 +77,7 @@ void hal_lld_init(void) {
|
|||
|
||||
/* Downcounter timer initialized for system tick use, TB enabled for debug
|
||||
and measurements.*/
|
||||
n = SPC5_SYSCLK / CH_FREQUENCY;
|
||||
n = SPC5_SYSCLK / CH_CFG_FREQUENCY;
|
||||
asm volatile ("li %%r3, 0 \t\n"
|
||||
"mtspr 284, %%r3 \t\n" /* Clear TBL register. */
|
||||
"mtspr 285, %%r3 \t\n" /* Clear TBU register. */
|
||||
|
|
|
@ -89,7 +89,7 @@ void hal_lld_init(void) {
|
|||
/* Decrementer timer initialized for system tick use, note, it is
|
||||
initialized here because in the OSAL layer the system clock frequency
|
||||
is not yet known.*/
|
||||
n = SPC5_SYSCLK / CH_FREQUENCY;
|
||||
n = SPC5_SYSCLK / CH_CFG_FREQUENCY;
|
||||
asm volatile ("mtspr 22, %[n] \t\n" /* Init. DEC register. */
|
||||
"mtspr 54, %[n] \t\n" /* Init. DECAR register.*/
|
||||
"lis %%r3, 0x0440 \t\n" /* DIE ARE bits. */
|
||||
|
|
|
@ -62,7 +62,7 @@ void hal_lld_init(void) {
|
|||
/* Decrementer timer initialized for system tick use, note, it is
|
||||
initialized here because in the OSAL layer the system clock frequency
|
||||
is not yet known.*/
|
||||
n = halSPCGetSystemClock() / CH_FREQUENCY;
|
||||
n = halSPCGetSystemClock() / CH_CFG_FREQUENCY;
|
||||
asm volatile ("mtspr 22, %[n] \t\n" /* Init. DEC register. */
|
||||
"mtspr 54, %[n] \t\n" /* Init. DECAR register.*/
|
||||
"lis %%r3, 0x0440 \t\n" /* DIE ARE bits. */
|
||||
|
|
|
@ -438,12 +438,12 @@ struct SPIDriver {
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -585,12 +585,12 @@ struct ADCDriver {
|
|||
Thread *thread;
|
||||
#endif
|
||||
#if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the peripheral.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* ADC_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -365,12 +365,12 @@ struct I2CDriver {
|
|||
*/
|
||||
i2cflags_t errors;
|
||||
#if I2C_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* I2C_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -243,12 +243,12 @@ struct I2CDriver{
|
|||
*/
|
||||
i2cflags_t errors;
|
||||
#if I2C_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* I2C_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -331,12 +331,12 @@ struct SPIDriver{
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -344,12 +344,12 @@ struct SPIDriver{
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -267,12 +267,12 @@ struct ADCDriver {
|
|||
Thread *thread;
|
||||
#endif
|
||||
#if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the peripheral.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* ADC_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -104,7 +104,7 @@ void hal_lld_init(void) {
|
|||
rccResetAPB2(~RCC_APB2RSTR_DBGMCURST);
|
||||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
SysTick->LOAD = STM32_HCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = STM32_HCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -279,12 +279,12 @@ struct ADCDriver {
|
|||
Thread *thread;
|
||||
#endif
|
||||
#if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the peripheral.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* ADC_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -103,7 +103,7 @@ void hal_lld_init(void) {
|
|||
rccResetAPB2(0xFFFFFFFF);
|
||||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
SysTick->LOAD = STM32_HCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = STM32_HCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -478,12 +478,12 @@ struct ADCDriver {
|
|||
Thread *thread;
|
||||
#endif
|
||||
#if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the peripheral.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* ADC_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -104,7 +104,7 @@ void hal_lld_init(void) {
|
|||
rccResetAPB2(0xFFFFFFFF);
|
||||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
SysTick->LOAD = STM32_HCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = STM32_HCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -524,12 +524,12 @@ struct ADCDriver {
|
|||
Thread *thread;
|
||||
#endif
|
||||
#if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the peripheral.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* ADC_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -104,7 +104,7 @@ void hal_lld_init(void) {
|
|||
rccResetAPB2(0xFFFFFFFF);
|
||||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
SysTick->LOAD = STM32_HCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = STM32_HCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -440,12 +440,12 @@ struct ADCDriver {
|
|||
Thread *thread;
|
||||
#endif
|
||||
#if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the peripheral.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* ADC_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -102,7 +102,7 @@ void hal_lld_init(void) {
|
|||
rccResetAPB2(~0);
|
||||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
SysTick->LOAD = STM32_HCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = STM32_HCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -346,12 +346,12 @@ struct ADCDriver {
|
|||
Thread *thread;
|
||||
#endif
|
||||
#if ADC_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the peripheral.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* ADC_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -99,7 +99,7 @@ void hal_lld_init(void) {
|
|||
rccResetAPB2(~0);
|
||||
|
||||
/* SysTick initialization using the system clock.*/
|
||||
SysTick->LOAD = STM32_HCLK / CH_FREQUENCY - 1;
|
||||
SysTick->LOAD = STM32_HCLK / CH_CFG_FREQUENCY - 1;
|
||||
SysTick->VAL = 0;
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk |
|
||||
|
|
|
@ -119,12 +119,12 @@ struct SPIDriver {
|
|||
Thread *thread;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Mutex protecting the bus.
|
||||
*/
|
||||
Mutex mutex;
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
Semaphore semaphore;
|
||||
#endif
|
||||
#endif /* SPI_USE_MUTUAL_EXCLUSION */
|
||||
|
|
|
@ -64,7 +64,7 @@ void hal_lld_init(void) {
|
|||
printf("QueryPerformanceFrequency() error");
|
||||
exit(1);
|
||||
}
|
||||
slice.QuadPart /= CH_FREQUENCY;
|
||||
slice.QuadPart /= CH_CFG_FREQUENCY;
|
||||
QueryPerformanceCounter(&nextcnt);
|
||||
nextcnt.QuadPart += slice.QuadPart;
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ void adcObjectInit(ADCDriver *adcp) {
|
|||
adcp->thread = NULL;
|
||||
#endif /* ADC_USE_WAIT */
|
||||
#if ADC_USE_MUTUAL_EXCLUSION
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
chMtxInit(&adcp->mutex);
|
||||
#else
|
||||
chSemInit(&adcp->semaphore, 1);
|
||||
|
@ -309,9 +309,9 @@ void adcAcquireBus(ADCDriver *adcp) {
|
|||
|
||||
chDbgCheck(adcp != NULL, "adcAcquireBus");
|
||||
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
chMtxLock(&adcp->mutex);
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
chSemWait(&adcp->semaphore);
|
||||
#endif
|
||||
}
|
||||
|
@ -329,10 +329,10 @@ void adcReleaseBus(ADCDriver *adcp) {
|
|||
|
||||
chDbgCheck(adcp != NULL, "adcReleaseBus");
|
||||
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
(void)adcp;
|
||||
chMtxUnlock();
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
chSemSignal(&adcp->semaphore);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -78,11 +78,11 @@ void i2cObjectInit(I2CDriver *i2cp) {
|
|||
i2cp->config = NULL;
|
||||
|
||||
#if I2C_USE_MUTUAL_EXCLUSION
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
chMtxInit(&i2cp->mutex);
|
||||
#else
|
||||
chSemInit(&i2cp->semaphore, 1);
|
||||
#endif /* CH_USE_MUTEXES */
|
||||
#endif /* CH_CFG_USE_MUTEXES */
|
||||
#endif /* I2C_USE_MUTUAL_EXCLUSION */
|
||||
|
||||
#if defined(I2C_DRIVER_EXT_INIT_HOOK)
|
||||
|
@ -270,9 +270,9 @@ void i2cAcquireBus(I2CDriver *i2cp) {
|
|||
|
||||
chDbgCheck(i2cp != NULL, "i2cAcquireBus");
|
||||
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
chMtxLock(&i2cp->mutex);
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
chSemWait(&i2cp->semaphore);
|
||||
#endif
|
||||
}
|
||||
|
@ -290,9 +290,9 @@ void i2cReleaseBus(I2CDriver *i2cp) {
|
|||
|
||||
chDbgCheck(i2cp != NULL, "i2cReleaseBus");
|
||||
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
chMtxUnlock();
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
chSemSignal(&i2cp->semaphore);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ void spiObjectInit(SPIDriver *spip) {
|
|||
spip->thread = NULL;
|
||||
#endif /* SPI_USE_WAIT */
|
||||
#if SPI_USE_MUTUAL_EXCLUSION
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
chMtxInit(&spip->mutex);
|
||||
#else
|
||||
chSemInit(&spip->semaphore, 1);
|
||||
|
@ -405,9 +405,9 @@ void spiAcquireBus(SPIDriver *spip) {
|
|||
|
||||
chDbgCheck(spip != NULL, "spiAcquireBus");
|
||||
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
chMtxLock(&spip->mutex);
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
chSemWait(&spip->semaphore);
|
||||
#endif
|
||||
}
|
||||
|
@ -425,10 +425,10 @@ void spiReleaseBus(SPIDriver *spip) {
|
|||
|
||||
chDbgCheck(spip != NULL, "spiReleaseBus");
|
||||
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
(void)spip;
|
||||
chMtxUnlock();
|
||||
#elif CH_USE_SEMAPHORES
|
||||
#elif CH_CFG_USE_SEMAPHORES
|
||||
chSemSignal(&spip->semaphore);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
* mutexes can only be taken and released by the same thread. Another
|
||||
* difference is that binary semaphores, unlike mutexes, do not
|
||||
* implement the priority inheritance protocol.<br>
|
||||
* In order to use the binary semaphores APIs the @p CH_USE_SEMAPHORES
|
||||
* In order to use the binary semaphores APIs the @p CH_CFG_USE_SEMAPHORES
|
||||
* option must be enabled in @p chconf.h.
|
||||
* @{
|
||||
*/
|
||||
|
@ -51,7 +51,7 @@
|
|||
#ifndef _CHBSEM_H_
|
||||
#define _CHBSEM_H_
|
||||
|
||||
#if CH_USE_SEMAPHORES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -305,7 +305,7 @@ static inline bool chBSemGetStateI(binary_semaphore_t *bsp) {
|
|||
return bsp->bs_sem.s_cnt > 0 ? false : true;
|
||||
}
|
||||
|
||||
#endif /* CH_USE_SEMAPHORES */
|
||||
#endif /* CH_CFG_USE_SEMAPHORES */
|
||||
|
||||
#endif /* _CHBSEM_H_ */
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#ifndef _CHCOND_H_
|
||||
#define _CHCOND_H_
|
||||
|
||||
#if CH_USE_CONDVARS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -46,8 +46,8 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !CH_USE_MUTEXES
|
||||
#error "CH_USE_CONDVARS requires CH_USE_MUTEXES"
|
||||
#if !CH_CFG_USE_MUTEXES
|
||||
#error "CH_CFG_USE_CONDVARS requires CH_CFG_USE_MUTEXES"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
@ -98,7 +98,7 @@ extern "C" {
|
|||
void chCondBroadcastI(condition_variable_t *cp);
|
||||
msg_t chCondWait(condition_variable_t *cp);
|
||||
msg_t chCondWaitS(condition_variable_t *cp);
|
||||
#if CH_USE_CONDVARS_TIMEOUT
|
||||
#if CH_CFG_USE_CONDVARS_TIMEOUT
|
||||
msg_t chCondWaitTimeout(condition_variable_t *cp, systime_t time);
|
||||
msg_t chCondWaitTimeoutS(condition_variable_t *cp, systime_t time);
|
||||
#endif
|
||||
|
@ -110,7 +110,7 @@ extern "C" {
|
|||
/* Module inline functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CH_USE_CONDVARS */
|
||||
#endif /* CH_CFG_USE_CONDVARS */
|
||||
|
||||
#endif /* _CHCOND_H_ */
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _CHDYNAMIC_H_
|
||||
#define _CHDYNAMIC_H_
|
||||
|
||||
#if CH_USE_DYNAMIC || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_DYNAMIC || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -46,11 +46,11 @@
|
|||
/*
|
||||
* Module dependencies check.
|
||||
*/
|
||||
#if CH_USE_DYNAMIC && !CH_USE_WAITEXIT
|
||||
#error "CH_USE_DYNAMIC requires CH_USE_WAITEXIT"
|
||||
#if CH_CFG_USE_DYNAMIC && !CH_CFG_USE_WAITEXIT
|
||||
#error "CH_CFG_USE_DYNAMIC requires CH_CFG_USE_WAITEXIT"
|
||||
#endif
|
||||
#if CH_USE_DYNAMIC && !CH_USE_HEAP && !CH_USE_MEMPOOLS
|
||||
#error "CH_USE_DYNAMIC requires CH_USE_HEAP and/or CH_USE_MEMPOOLS"
|
||||
#if CH_CFG_USE_DYNAMIC && !CH_CFG_USE_HEAP && !CH_CFG_USE_MEMPOOLS
|
||||
#error "CH_CFG_USE_DYNAMIC requires CH_CFG_USE_HEAP and/or CH_CFG_USE_MEMPOOLS"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
@ -73,11 +73,11 @@ extern "C" {
|
|||
#endif
|
||||
thread_t *chThdAddRef(thread_t *tp);
|
||||
void chThdRelease(thread_t *tp);
|
||||
#if CH_USE_HEAP
|
||||
#if CH_CFG_USE_HEAP
|
||||
thread_t *chThdCreateFromHeap(memory_heap_t *heapp, size_t size,
|
||||
tprio_t prio, tfunc_t pf, void *arg);
|
||||
#endif
|
||||
#if CH_USE_MEMPOOLS
|
||||
#if CH_CFG_USE_MEMPOOLS
|
||||
thread_t *chThdCreateFromMemoryPool(memory_pool_t *mp, tprio_t prio,
|
||||
tfunc_t pf, void *arg);
|
||||
#endif
|
||||
|
@ -89,7 +89,7 @@ extern "C" {
|
|||
/* Module inline functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CH_USE_DYNAMIC */
|
||||
#endif /* CH_CFG_USE_DYNAMIC */
|
||||
|
||||
#endif /* _CHDYNAMIC_H_ */
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#ifndef _CHEVENTS_H_
|
||||
#define _CHEVENTS_H_
|
||||
|
||||
#if CH_USE_EVENTS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -131,12 +131,12 @@ extern "C" {
|
|||
void chEvtBroadcastFlags(event_source_t *esp, eventflags_t flags);
|
||||
void chEvtBroadcastFlagsI(event_source_t *esp, eventflags_t flags);
|
||||
void chEvtDispatch(const evhandler_t *handlers, eventmask_t mask);
|
||||
#if CH_OPTIMIZE_SPEED || !CH_USE_EVENTS_TIMEOUT
|
||||
#if CH_CFG_OPTIMIZE_SPEED || !CH_CFG_USE_EVENTS_TIMEOUT
|
||||
eventmask_t chEvtWaitOne(eventmask_t mask);
|
||||
eventmask_t chEvtWaitAny(eventmask_t mask);
|
||||
eventmask_t chEvtWaitAll(eventmask_t mask);
|
||||
#endif
|
||||
#if CH_USE_EVENTS_TIMEOUT
|
||||
#if CH_CFG_USE_EVENTS_TIMEOUT
|
||||
eventmask_t chEvtWaitOneTimeout(eventmask_t mask, systime_t time);
|
||||
eventmask_t chEvtWaitAnyTimeout(eventmask_t mask, systime_t time);
|
||||
eventmask_t chEvtWaitAllTimeout(eventmask_t mask, systime_t time);
|
||||
|
@ -145,7 +145,7 @@ extern "C" {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if !CH_OPTIMIZE_SPEED && CH_USE_EVENTS_TIMEOUT
|
||||
#if !CH_CFG_OPTIMIZE_SPEED && CH_CFG_USE_EVENTS_TIMEOUT
|
||||
#define chEvtWaitOne(mask) chEvtWaitOneTimeout(mask, TIME_INFINITE)
|
||||
#define chEvtWaitAny(mask) chEvtWaitAnyTimeout(mask, TIME_INFINITE)
|
||||
#define chEvtWaitAll(mask) chEvtWaitAllTimeout(mask, TIME_INFINITE)
|
||||
|
@ -233,7 +233,7 @@ static inline void chEvtBroadcastI(event_source_t *esp) {
|
|||
chEvtBroadcastFlagsI(esp, 0);
|
||||
}
|
||||
|
||||
#endif /* CH_USE_EVENTS */
|
||||
#endif /* CH_CFG_USE_EVENTS */
|
||||
|
||||
#endif /* _CHEVENTS_H_ */
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _CHHEAP_H_
|
||||
#define _CHHEAP_H_
|
||||
|
||||
#if CH_USE_HEAP || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_HEAP || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -43,12 +43,12 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !CH_USE_MEMCORE
|
||||
#error "CH_USE_HEAP requires CH_USE_MEMCORE"
|
||||
#if !CH_CFG_USE_MEMCORE
|
||||
#error "CH_CFG_USE_HEAP requires CH_CFG_USE_MEMCORE"
|
||||
#endif
|
||||
|
||||
#if !CH_USE_MUTEXES && !CH_USE_SEMAPHORES
|
||||
#error "CH_USE_HEAP requires CH_USE_MUTEXES and/or CH_USE_SEMAPHORES"
|
||||
#if !CH_CFG_USE_MUTEXES && !CH_CFG_USE_SEMAPHORES
|
||||
#error "CH_CFG_USE_HEAP requires CH_CFG_USE_MUTEXES and/or CH_CFG_USE_SEMAPHORES"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
@ -81,7 +81,7 @@ struct memory_heap {
|
|||
memgetfunc_t h_provider; /**< @brief Memory blocks provider for
|
||||
this heap. */
|
||||
union heap_header h_free; /**< @brief Free blocks list header. */
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
mutex_t h_mtx; /**< @brief Heap access mutex. */
|
||||
#else
|
||||
semaphore_t h_sem; /**< @brief Heap access semaphore. */
|
||||
|
@ -112,7 +112,7 @@ extern "C" {
|
|||
/* Module inline functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CH_USE_HEAP */
|
||||
#endif /* CH_CFG_USE_HEAP */
|
||||
|
||||
#endif /* _CHHEAP_H_ */
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ static inline bool queue_notempty(threads_queue_t *tqp) {
|
|||
|
||||
/* If the performance code path has been chosen then all the following
|
||||
functions are inlined into the various kernel modules.*/
|
||||
#if CH_OPTIMIZE_SPEED
|
||||
#if CH_CFG_OPTIMIZE_SPEED
|
||||
static inline void list_insert(thread_t *tp, threads_list_t *tlp) {
|
||||
|
||||
tp->p_next = tlp->p_next;
|
||||
|
@ -190,6 +190,6 @@ static inline thread_t *queue_dequeue(thread_t *tp) {
|
|||
tp->p_next->p_prev = tp->p_prev;
|
||||
return tp;
|
||||
}
|
||||
#endif /* CH_OPTIMIZE_SPEED */
|
||||
#endif /* CH_CFG_OPTIMIZE_SPEED */
|
||||
|
||||
#endif /* _CHLISTS_H_ */
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _CHMBOXES_H_
|
||||
#define _CHMBOXES_H_
|
||||
|
||||
#if CH_USE_MAILBOXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MAILBOXES || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -43,8 +43,8 @@
|
|||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !CH_USE_SEMAPHORES
|
||||
#error "CH_USE_MAILBOXES requires CH_USE_SEMAPHORES"
|
||||
#if !CH_CFG_USE_SEMAPHORES
|
||||
#error "CH_CFG_USE_MAILBOXES requires CH_CFG_USE_SEMAPHORES"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
@ -193,7 +193,7 @@ static inline cnt_t chMBPeekI(mailbox_t *mbp) {
|
|||
return *mbp->mb_rdptr;
|
||||
}
|
||||
|
||||
#endif /* CH_USE_MAILBOXES */
|
||||
#endif /* CH_CFG_USE_MAILBOXES */
|
||||
|
||||
#endif /* _CHMBOXES_H_ */
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _CHMEMCORE_H_
|
||||
#define _CHMEMCORE_H_
|
||||
|
||||
#if CH_USE_MEMCORE || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MEMCORE || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -107,7 +107,7 @@ extern "C" {
|
|||
/* Module inline functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CH_USE_MEMCORE */
|
||||
#endif /* CH_CFG_USE_MEMCORE */
|
||||
|
||||
#endif /* _CHMEMCORE_H_ */
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _CHMEMPOOLS_H_
|
||||
#define _CHMEMPOOLS_H_
|
||||
|
||||
#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -39,8 +39,8 @@
|
|||
/* Module pre-compile time settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !CH_USE_MEMCORE
|
||||
#error "CH_USE_MEMPOOLS requires CH_USE_MEMCORE"
|
||||
#if !CH_CFG_USE_MEMCORE
|
||||
#error "CH_CFG_USE_MEMPOOLS requires CH_CFG_USE_MEMCORE"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
@ -162,7 +162,7 @@ static inline void chPoolAddI(memory_pool_t *mp, void *objp) {
|
|||
chPoolFreeI(mp, objp);
|
||||
}
|
||||
|
||||
#endif /* CH_USE_MEMPOOLS */
|
||||
#endif /* CH_CFG_USE_MEMPOOLS */
|
||||
|
||||
#endif /* _CHMEMPOOLS_H_ */
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _CHMSG_H_
|
||||
#define _CHMSG_H_
|
||||
|
||||
#if CH_USE_MESSAGES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MESSAGES || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -113,7 +113,7 @@ static inline void chMsgReleaseS(thread_t *tp, msg_t msg) {
|
|||
chSchWakeupS(tp, msg);
|
||||
}
|
||||
|
||||
#endif /* CH_USE_MESSAGES */
|
||||
#endif /* CH_CFG_USE_MESSAGES */
|
||||
|
||||
#endif /* _CHMSG_H_ */
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _CHMTX_H_
|
||||
#define _CHMTX_H_
|
||||
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -119,7 +119,7 @@ static inline bool chMtxQueueNotEmptyS(mutex_t *mp) {
|
|||
return queue_notempty(&mp->m_queue);
|
||||
}
|
||||
|
||||
#endif /* CH_USE_MUTEXES */
|
||||
#endif /* CH_CFG_USE_MUTEXES */
|
||||
|
||||
#endif /* _CHMTX_H_ */
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _CHQUEUES_H_
|
||||
#define _CHQUEUES_H_
|
||||
|
||||
#if CH_USE_QUEUES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_QUEUES || defined(__DOXYGEN__)
|
||||
|
||||
/**
|
||||
* @name Queue functions returned status value
|
||||
|
@ -362,7 +362,8 @@ extern "C" {
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* CH_USE_QUEUES */
|
||||
|
||||
#endif /* CH_CFG_USE_QUEUES */
|
||||
|
||||
#endif /* _CHQUEUES_H_ */
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _CHREGISTRY_H_
|
||||
#define _CHREGISTRY_H_
|
||||
|
||||
#if CH_USE_REGISTRY || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -121,7 +121,7 @@ extern "C" {
|
|||
/**
|
||||
* @brief Sets the current thread name.
|
||||
* @pre This function only stores the pointer to the name if the option
|
||||
* @p CH_USE_REGISTRY is enabled else no action is performed.
|
||||
* @p CH_CFG_USE_REGISTRY is enabled else no action is performed.
|
||||
*
|
||||
* @param[in] p thread name as a zero terminated string
|
||||
*
|
||||
|
@ -129,7 +129,7 @@ extern "C" {
|
|||
*/
|
||||
static inline void chRegSetThreadName(const char *name) {
|
||||
|
||||
#if CH_USE_REGISTRY
|
||||
#if CH_CFG_USE_REGISTRY
|
||||
currp->p_name = name;
|
||||
#else
|
||||
(void)name;
|
||||
|
@ -139,7 +139,7 @@ static inline void chRegSetThreadName(const char *name) {
|
|||
/**
|
||||
* @brief Returns the name of the specified thread.
|
||||
* @pre This function only returns the pointer to the name if the option
|
||||
* @p CH_USE_REGISTRY is enabled else @p NULL is returned.
|
||||
* @p CH_CFG_USE_REGISTRY is enabled else @p NULL is returned.
|
||||
*
|
||||
* @param[in] tp pointer to the thread
|
||||
*
|
||||
|
@ -152,7 +152,7 @@ static inline const char *chRegGetThreadNameI(thread_t *tp) {
|
|||
|
||||
chDbgCheckClassI();
|
||||
|
||||
#if CH_USE_REGISTRY
|
||||
#if CH_CFG_USE_REGISTRY
|
||||
return tp->p_name;
|
||||
#else
|
||||
(void)tp;
|
||||
|
@ -160,7 +160,7 @@ static inline const char *chRegGetThreadNameI(thread_t *tp) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#endif /* CH_USE_REGISTRY */
|
||||
#endif /* CH_CFG_USE_REGISTRY */
|
||||
|
||||
#endif /* _CHREGISTRY_H_ */
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ typedef struct {
|
|||
initialized to zero. */
|
||||
struct context r_ctx; /**< @brief Not used, present because
|
||||
offsets. */
|
||||
#if CH_USE_REGISTRY || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
|
||||
thread_t *r_newer; /**< @brief Newer registry element. */
|
||||
thread_t *r_older; /**< @brief Older registry element. */
|
||||
#endif
|
||||
|
@ -222,7 +222,7 @@ static inline void chSchPreemption(void) {
|
|||
tprio_t p1 = firstprio(&rlist.r_queue);
|
||||
tprio_t p2 = currp->p_prio;
|
||||
|
||||
#if CH_TIME_QUANTUM > 0
|
||||
#if CH_CFG_TIME_QUANTUM > 0
|
||||
if (currp->p_preempt) {
|
||||
if (p1 > p2)
|
||||
chSchDoRescheduleAhead();
|
||||
|
@ -231,10 +231,10 @@ static inline void chSchPreemption(void) {
|
|||
if (p1 >= p2)
|
||||
chSchDoRescheduleBehind();
|
||||
}
|
||||
#else /* CH_TIME_QUANTUM == 0 */
|
||||
#else /* CH_CFG_TIME_QUANTUM == 0 */
|
||||
if (p1 >= p2)
|
||||
chSchDoRescheduleAhead();
|
||||
#endif /* CH_TIME_QUANTUM == 0 */
|
||||
#endif /* CH_CFG_TIME_QUANTUM == 0 */
|
||||
}
|
||||
|
||||
#endif /* _CHSCHD_H_ */
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _CHSEM_H_
|
||||
#define _CHSEM_H_
|
||||
|
||||
#if CH_USE_SEMAPHORES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -99,9 +99,7 @@ extern "C" {
|
|||
void chSemSignal(semaphore_t *sp);
|
||||
void chSemSignalI(semaphore_t *sp);
|
||||
void chSemAddCounterI(semaphore_t *sp, cnt_t n);
|
||||
#if CH_USE_SEMSW
|
||||
msg_t chSemSignalWait(semaphore_t *sps, semaphore_t *spw);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -149,7 +147,7 @@ static inline cnt_t chSemGetCounterI(semaphore_t *sp) {
|
|||
return sp->s_cnt;
|
||||
}
|
||||
|
||||
#endif /* CH_USE_SEMAPHORES */
|
||||
#endif /* CH_CFG_USE_SEMAPHORES */
|
||||
|
||||
#endif /* _CHSEM_H_ */
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ extern "C" {
|
|||
static inline void chSysSwitch(thread_t *ntp, thread_t *otp) {
|
||||
|
||||
dbg_trace(otp);
|
||||
THREAD_CONTEXT_SWITCH_HOOK(ntp, otp);
|
||||
CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp);
|
||||
port_switch(ntp, otp);
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
|
||||
/* Forward declaration required by the mutexes stack structure present
|
||||
in every thread.*/
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
typedef struct mutex mutex_t;
|
||||
#endif
|
||||
|
||||
|
@ -131,12 +131,12 @@ typedef struct thread {
|
|||
/* End of the fields shared with the threads_queue_t structure.*/
|
||||
tprio_t p_prio; /**< @brief Thread priority. */
|
||||
struct context p_ctx; /**< @brief Processor context. */
|
||||
#if CH_USE_REGISTRY || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
|
||||
thread_t *p_newer; /**< @brief Newer registry element. */
|
||||
thread_t *p_older; /**< @brief Older registry element. */
|
||||
#endif
|
||||
/* End of the fields shared with the ReadyList structure. */
|
||||
#if CH_USE_REGISTRY || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Thread name or @p NULL.
|
||||
*/
|
||||
|
@ -156,7 +156,7 @@ typedef struct thread {
|
|||
* @brief Various thread flags.
|
||||
*/
|
||||
tmode_t p_flags;
|
||||
#if CH_USE_DYNAMIC || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_DYNAMIC || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief References to this thread.
|
||||
*/
|
||||
|
@ -165,7 +165,7 @@ typedef struct thread {
|
|||
/**
|
||||
* @brief Number of ticks remaining to this thread.
|
||||
*/
|
||||
#if (CH_TIME_QUANTUM > 0) || defined(__DOXYGEN__)
|
||||
#if (CH_CFG_TIME_QUANTUM > 0) || defined(__DOXYGEN__)
|
||||
tslices_t p_preempt;
|
||||
#endif
|
||||
#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
|
||||
|
@ -202,7 +202,7 @@ typedef struct thread {
|
|||
* states.
|
||||
*/
|
||||
void *wtobjp;
|
||||
#if CH_USE_EVENTS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Enabled events mask.
|
||||
* @note This field is only valid while the thread is in the
|
||||
|
@ -211,13 +211,13 @@ typedef struct thread {
|
|||
eventmask_t ewmask;
|
||||
#endif
|
||||
} p_u;
|
||||
#if CH_USE_WAITEXIT || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_WAITEXIT || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Termination waiting list.
|
||||
*/
|
||||
threads_list_t p_waiting;
|
||||
#endif
|
||||
#if CH_USE_MESSAGES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MESSAGES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Messages queue.
|
||||
*/
|
||||
|
@ -227,13 +227,13 @@ typedef struct thread {
|
|||
*/
|
||||
msg_t p_msg;
|
||||
#endif
|
||||
#if CH_USE_EVENTS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Pending events mask.
|
||||
*/
|
||||
eventmask_t p_epending;
|
||||
#endif
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief List of the mutexes owned by this thread.
|
||||
* @note The list is terminated by a @p NULL in this field.
|
||||
|
@ -244,15 +244,15 @@ typedef struct thread {
|
|||
*/
|
||||
tprio_t p_realprio;
|
||||
#endif
|
||||
#if (CH_USE_DYNAMIC && CH_USE_MEMPOOLS) || defined(__DOXYGEN__)
|
||||
#if (CH_CFG_USE_DYNAMIC && CH_CFG_USE_MEMPOOLS) || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Memory Pool where the thread workspace is returned.
|
||||
*/
|
||||
void *p_mpool;
|
||||
#endif
|
||||
#if defined(THREAD_EXT_FIELDS)
|
||||
#if defined(CH_CFG_THREAD_EXTRA_FIELDS)
|
||||
/* Extra fields defined in chconf.h.*/
|
||||
THREAD_EXT_FIELDS
|
||||
CH_CFG_THREAD_EXTRA_FIELDS
|
||||
#endif
|
||||
} thread_t;
|
||||
|
||||
|
@ -405,7 +405,7 @@ extern "C" {
|
|||
void chThdYield(void);
|
||||
void chThdExit(msg_t msg);
|
||||
void chThdExitS(msg_t msg);
|
||||
#if CH_USE_WAITEXIT
|
||||
#if CH_CFG_USE_WAITEXIT
|
||||
msg_t chThdWait(thread_t *tp);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -104,7 +104,7 @@ struct virtual_timer {
|
|||
* @api
|
||||
*/
|
||||
#define S2ST(sec) \
|
||||
((systime_t)((uint32_t)(sec) * (uint32_t)CH_FREQUENCY))
|
||||
((systime_t)((uint32_t)(sec) * (uint32_t)CH_CFG_FREQUENCY))
|
||||
|
||||
/**
|
||||
* @brief Milliseconds to system ticks.
|
||||
|
@ -117,7 +117,7 @@ struct virtual_timer {
|
|||
* @api
|
||||
*/
|
||||
#define MS2ST(msec) \
|
||||
((systime_t)(((((uint32_t)(msec)) * ((uint32_t)CH_FREQUENCY) - 1UL) / \
|
||||
((systime_t)(((((uint32_t)(msec)) * ((uint32_t)CH_CFG_FREQUENCY) - 1UL) / \
|
||||
1000UL) + 1UL))
|
||||
|
||||
/**
|
||||
|
@ -131,7 +131,7 @@ struct virtual_timer {
|
|||
* @api
|
||||
*/
|
||||
#define US2ST(usec) \
|
||||
((systime_t)(((((uint32_t)(usec)) * ((uint32_t)CH_FREQUENCY) - 1UL) / \
|
||||
((systime_t)(((((uint32_t)(usec)) * ((uint32_t)CH_CFG_FREQUENCY) - 1UL) / \
|
||||
1000000UL) + 1UL))
|
||||
/** @} */
|
||||
|
||||
|
|
|
@ -33,14 +33,14 @@
|
|||
* The condition variable is a synchronization object meant to be
|
||||
* used inside a zone protected by a mutex. Mutexes and condition
|
||||
* variables together can implement a Monitor construct.
|
||||
* @pre In order to use the condition variable APIs the @p CH_USE_CONDVARS
|
||||
* @pre In order to use the condition variable APIs the @p CH_CFG_USE_CONDVARS
|
||||
* option must be enabled in @p chconf.h.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_CONDVARS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module local definitions. */
|
||||
|
@ -218,14 +218,14 @@ msg_t chCondWaitS(condition_variable_t *cp) {
|
|||
return msg;
|
||||
}
|
||||
|
||||
#if CH_USE_CONDVARS_TIMEOUT || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_CONDVARS_TIMEOUT || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Waits on the condition variable releasing the mutex lock.
|
||||
* @details Releases the currently owned mutex, waits on the condition
|
||||
* variable, and finally acquires the mutex again. All the sequence
|
||||
* is performed atomically.
|
||||
* @pre The invoking thread <b>must</b> have at least one owned mutex.
|
||||
* @pre The configuration option @p CH_USE_CONDVARS_TIMEOUT must be enabled
|
||||
* @pre The configuration option @p CH_CFG_USE_CONDVARS_TIMEOUT must be enabled
|
||||
* in order to use this function.
|
||||
* @post Exiting the function because a timeout does not re-acquire the
|
||||
* mutex, the mutex ownership is lost.
|
||||
|
@ -262,7 +262,7 @@ msg_t chCondWaitTimeout(condition_variable_t *cp, systime_t time) {
|
|||
* variable, and finally acquires the mutex again. All the sequence
|
||||
* is performed atomically.
|
||||
* @pre The invoking thread <b>must</b> have at least one owned mutex.
|
||||
* @pre The configuration option @p CH_USE_CONDVARS_TIMEOUT must be enabled
|
||||
* @pre The configuration option @p CH_CFG_USE_CONDVARS_TIMEOUT must be enabled
|
||||
* in order to use this function.
|
||||
* @post Exiting the function because a timeout does not re-acquire the
|
||||
* mutex, the mutex ownership is lost.
|
||||
|
@ -302,8 +302,8 @@ msg_t chCondWaitTimeoutS(condition_variable_t *cp, systime_t time) {
|
|||
chMtxLockS(mp);
|
||||
return msg;
|
||||
}
|
||||
#endif /* CH_USE_CONDVARS_TIMEOUT */
|
||||
#endif /* CH_CFG_USE_CONDVARS_TIMEOUT */
|
||||
|
||||
#endif /* CH_USE_CONDVARS */
|
||||
#endif /* CH_CFG_USE_CONDVARS */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_DYNAMIC || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_DYNAMIC || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module local definitions. */
|
||||
|
@ -57,7 +57,7 @@
|
|||
|
||||
/**
|
||||
* @brief Adds a reference to a thread object.
|
||||
* @pre The configuration option @p CH_USE_DYNAMIC must be enabled in order
|
||||
* @pre The configuration option @p CH_CFG_USE_DYNAMIC must be enabled in order
|
||||
* to use this function.
|
||||
*
|
||||
* @param[in] tp pointer to the thread
|
||||
|
@ -80,7 +80,7 @@ thread_t *chThdAddRef(thread_t *tp) {
|
|||
* @details If the references counter reaches zero <b>and</b> the thread
|
||||
* is in the @p THD_STATE_FINAL state then the thread's memory is
|
||||
* returned to the proper allocator.
|
||||
* @pre The configuration option @p CH_USE_DYNAMIC must be enabled in order
|
||||
* @pre The configuration option @p CH_CFG_USE_DYNAMIC must be enabled in order
|
||||
* to use this function.
|
||||
* @note Static threads are not affected.
|
||||
*
|
||||
|
@ -101,17 +101,17 @@ void chThdRelease(thread_t *tp) {
|
|||
allocator. Of course static threads are not affected.*/
|
||||
if ((refs == 0) && (tp->p_state == THD_STATE_FINAL)) {
|
||||
switch (tp->p_flags & THD_MEM_MODE_MASK) {
|
||||
#if CH_USE_HEAP
|
||||
#if CH_CFG_USE_HEAP
|
||||
case THD_MEM_MODE_HEAP:
|
||||
#if CH_USE_REGISTRY
|
||||
#if CH_CFG_USE_REGISTRY
|
||||
REG_REMOVE(tp);
|
||||
#endif
|
||||
chHeapFree(tp);
|
||||
break;
|
||||
#endif
|
||||
#if CH_USE_MEMPOOLS
|
||||
#if CH_CFG_USE_MEMPOOLS
|
||||
case THD_MEM_MODE_MEMPOOL:
|
||||
#if CH_USE_REGISTRY
|
||||
#if CH_CFG_USE_REGISTRY
|
||||
REG_REMOVE(tp);
|
||||
#endif
|
||||
chPoolFree(tp->p_mpool, tp);
|
||||
|
@ -121,10 +121,10 @@ void chThdRelease(thread_t *tp) {
|
|||
}
|
||||
}
|
||||
|
||||
#if CH_USE_HEAP || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_HEAP || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Creates a new thread allocating the memory from the heap.
|
||||
* @pre The configuration options @p CH_USE_DYNAMIC and @p CH_USE_HEAP
|
||||
* @pre The configuration options @p CH_CFG_USE_DYNAMIC and @p CH_CFG_USE_HEAP
|
||||
* must be enabled in order to use this function.
|
||||
* @note A thread can terminate by calling @p chThdExit() or by simply
|
||||
* returning from its main function.
|
||||
|
@ -169,13 +169,13 @@ thread_t *chThdCreateFromHeap(memory_heap_t *heapp, size_t size,
|
|||
chSysUnlock();
|
||||
return tp;
|
||||
}
|
||||
#endif /* CH_USE_HEAP */
|
||||
#endif /* CH_CFG_USE_HEAP */
|
||||
|
||||
#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Creates a new thread allocating the memory from the specified
|
||||
* memory pool.
|
||||
* @pre The configuration options @p CH_USE_DYNAMIC and @p CH_USE_MEMPOOLS
|
||||
* @pre The configuration options @p CH_CFG_USE_DYNAMIC and @p CH_CFG_USE_MEMPOOLS
|
||||
* must be enabled in order to use this function.
|
||||
* @note A thread can terminate by calling @p chThdExit() or by simply
|
||||
* returning from its main function.
|
||||
|
@ -221,8 +221,8 @@ thread_t *chThdCreateFromMemoryPool(memory_pool_t *mp, tprio_t prio,
|
|||
chSysUnlock();
|
||||
return tp;
|
||||
}
|
||||
#endif /* CH_USE_MEMPOOLS */
|
||||
#endif /* CH_CFG_USE_MEMPOOLS */
|
||||
|
||||
#endif /* CH_USE_DYNAMIC */
|
||||
#endif /* CH_CFG_USE_DYNAMIC */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
* An unlimited number of Event Sources can exists in a system and
|
||||
* each thread can be listening on an unlimited number of
|
||||
* them.
|
||||
* @pre In order to use the Events APIs the @p CH_USE_EVENTS option must be
|
||||
* @pre In order to use the Events APIs the @p CH_CFG_USE_EVENTS option must be
|
||||
* enabled in @p chconf.h.
|
||||
* @post Enabling events requires 1-4 (depending on the architecture)
|
||||
* extra bytes in the @p thread_t structure.
|
||||
|
@ -60,7 +60,7 @@
|
|||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_EVENTS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module local definitions. */
|
||||
|
@ -350,7 +350,7 @@ void chEvtDispatch(const evhandler_t *handlers, eventmask_t mask) {
|
|||
}
|
||||
}
|
||||
|
||||
#if CH_OPTIMIZE_SPEED || !CH_USE_EVENTS_TIMEOUT || defined(__DOXYGEN__)
|
||||
#if CH_CFG_OPTIMIZE_SPEED || !CH_CFG_USE_EVENTS_TIMEOUT || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Waits for exactly one of the specified events.
|
||||
* @details The function waits for one event among those specified in
|
||||
|
@ -438,9 +438,9 @@ eventmask_t chEvtWaitAll(eventmask_t mask) {
|
|||
chSysUnlock();
|
||||
return mask;
|
||||
}
|
||||
#endif /* CH_OPTIMIZE_SPEED || !CH_USE_EVENTS_TIMEOUT */
|
||||
#endif /* CH_CFG_OPTIMIZE_SPEED || !CH_CFG_USE_EVENTS_TIMEOUT */
|
||||
|
||||
#if CH_USE_EVENTS_TIMEOUT || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS_TIMEOUT || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Waits for exactly one of the specified events.
|
||||
* @details The function waits for one event among those specified in
|
||||
|
@ -568,8 +568,8 @@ eventmask_t chEvtWaitAllTimeout(eventmask_t mask, systime_t time) {
|
|||
chSysUnlock();
|
||||
return mask;
|
||||
}
|
||||
#endif /* CH_USE_EVENTS_TIMEOUT */
|
||||
#endif /* CH_CFG_USE_EVENTS_TIMEOUT */
|
||||
|
||||
#endif /* CH_USE_EVENTS */
|
||||
#endif /* CH_CFG_USE_EVENTS */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -29,14 +29,14 @@
|
|||
* are functionally equivalent to the usual @p malloc() and @p free()
|
||||
* library functions. The main difference is that the OS heap APIs
|
||||
* are guaranteed to be thread safe.<br>
|
||||
* @pre In order to use the heap APIs the @p CH_USE_HEAP option must
|
||||
* @pre In order to use the heap APIs the @p CH_CFG_USE_HEAP option must
|
||||
* be enabled in @p chconf.h.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_HEAP || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_HEAP || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module local definitions. */
|
||||
|
@ -45,7 +45,7 @@
|
|||
/*
|
||||
* Defaults on the best synchronization mechanism available.
|
||||
*/
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#define H_LOCK(h) chMtxLock(&(h)->h_mtx)
|
||||
#define H_UNLOCK(h) chMtxUnlock()
|
||||
#else
|
||||
|
@ -87,7 +87,7 @@ void _heap_init(void) {
|
|||
default_heap.h_provider = chCoreAlloc;
|
||||
default_heap.h_free.h.u.next = (union heap_header *)NULL;
|
||||
default_heap.h_free.h.size = 0;
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
chMtxObjectInit(&default_heap.h_mtx);
|
||||
#else
|
||||
chSemObjectInit(&default_heap.h_sem, 1);
|
||||
|
@ -115,7 +115,7 @@ void chHeapObjectInit(memory_heap_t *heapp, void *buf, size_t size) {
|
|||
heapp->h_free.h.size = 0;
|
||||
hp->h.u.next = NULL;
|
||||
hp->h.size = size - sizeof(union heap_header);
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
chMtxObjectInit(&heapp->h_mtx);
|
||||
#else
|
||||
chSemObjectInit(&heapp->h_sem, 1);
|
||||
|
@ -273,6 +273,6 @@ size_t chHeapStatus(memory_heap_t *heapp, size_t *sizep) {
|
|||
return n;
|
||||
}
|
||||
|
||||
#endif /* CH_USE_HEAP */
|
||||
#endif /* CH_CFG_USE_HEAP */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
/* Module exported functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !CH_OPTIMIZE_SPEED || defined(__DOXYGEN__)
|
||||
#if !CH_CFG_OPTIMIZE_SPEED || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Inserts a thread into a priority ordered queue.
|
||||
* @note The insertion is done by scanning the list from the highest
|
||||
|
@ -175,6 +175,6 @@ thread_t *list_remove(threads_list_t *tlp) {
|
|||
tlp->p_next = tp->p_next;
|
||||
return tp;
|
||||
}
|
||||
#endif /* CH_OPTIMIZE_SPEED */
|
||||
#endif /* CH_CFG_OPTIMIZE_SPEED */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -45,14 +45,14 @@
|
|||
* example) from the posting side and free it on the fetching side.
|
||||
* Another approach is to set a "done" flag into the structure pointed
|
||||
* by the message.
|
||||
* @pre In order to use the mailboxes APIs the @p CH_USE_MAILBOXES option
|
||||
* @pre In order to use the mailboxes APIs the @p CH_CFG_USE_MAILBOXES option
|
||||
* must be enabled in @p chconf.h.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_MAILBOXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MAILBOXES || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module exported variables. */
|
||||
|
@ -393,6 +393,6 @@ msg_t chMBFetchI(mailbox_t *mbp, msg_t *msgp) {
|
|||
chSemSignalI(&mbp->mb_emptysem);
|
||||
return RDY_OK;
|
||||
}
|
||||
#endif /* CH_USE_MAILBOXES */
|
||||
#endif /* CH_CFG_USE_MAILBOXES */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -39,14 +39,14 @@
|
|||
* This allocator, alone, is also useful for very simple
|
||||
* applications that just require a simple way to get memory
|
||||
* blocks.
|
||||
* @pre In order to use the core memory manager APIs the @p CH_USE_MEMCORE
|
||||
* @pre In order to use the core memory manager APIs the @p CH_CFG_USE_MEMCORE
|
||||
* option must be enabled in @p chconf.h.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_MEMCORE || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MEMCORE || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module exported variables. */
|
||||
|
@ -77,17 +77,17 @@ static uint8_t *endmem;
|
|||
* @notapi
|
||||
*/
|
||||
void _core_init(void) {
|
||||
#if CH_MEMCORE_SIZE == 0
|
||||
#if CH_CFG_MEMCORE_SIZE == 0
|
||||
extern uint8_t __heap_base__[];
|
||||
extern uint8_t __heap_end__[];
|
||||
|
||||
nextmem = (uint8_t *)MEM_ALIGN_NEXT(__heap_base__);
|
||||
endmem = (uint8_t *)MEM_ALIGN_PREV(__heap_end__);
|
||||
#else
|
||||
static stkalign_t buffer[MEM_ALIGN_NEXT(CH_MEMCORE_SIZE)/MEM_ALIGN_SIZE];
|
||||
static stkalign_t buffer[MEM_ALIGN_NEXT(CH_CFG_MEMCORE_SIZE)/MEM_ALIGN_SIZE];
|
||||
|
||||
nextmem = (uint8_t *)&buffer[0];
|
||||
endmem = (uint8_t *)&buffer[MEM_ALIGN_NEXT(CH_MEMCORE_SIZE)/MEM_ALIGN_SIZE];
|
||||
endmem = (uint8_t *)&buffer[MEM_ALIGN_NEXT(CH_CFG_MEMCORE_SIZE)/MEM_ALIGN_SIZE];
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -148,6 +148,6 @@ size_t chCoreStatus(void) {
|
|||
|
||||
return (size_t)(endmem - nextmem);
|
||||
}
|
||||
#endif /* CH_USE_MEMCORE */
|
||||
#endif /* CH_CFG_USE_MEMCORE */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -31,14 +31,14 @@
|
|||
* Memory Pools do not enforce any alignment constraint on the
|
||||
* contained object however the objects must be properly aligned
|
||||
* to contain a pointer to void.
|
||||
* @pre In order to use the memory pools APIs the @p CH_USE_MEMPOOLS option
|
||||
* @pre In order to use the memory pools APIs the @p CH_CFG_USE_MEMPOOLS option
|
||||
* must be enabled in @p chconf.h.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module exported variables. */
|
||||
|
@ -189,6 +189,6 @@ void chPoolFree(memory_pool_t *mp, void *objp) {
|
|||
chSysUnlock();
|
||||
}
|
||||
|
||||
#endif /* CH_USE_MEMPOOLS */
|
||||
#endif /* CH_CFG_USE_MEMPOOLS */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
* architectures function pointers can be larger that @p msg_t.<br>
|
||||
* Messages are usually processed in FIFO order but it is possible to
|
||||
* process them in priority order by enabling the
|
||||
* @p CH_USE_MESSAGES_PRIORITY option in @p chconf.h.<br>
|
||||
* @pre In order to use the message APIs the @p CH_USE_MESSAGES option
|
||||
* @p CH_CFG_USE_MESSAGES_PRIORITY option in @p chconf.h.<br>
|
||||
* @pre In order to use the message APIs the @p CH_CFG_USE_MESSAGES option
|
||||
* must be enabled in @p chconf.h.
|
||||
* @post Enabling messages requires 6-12 (depending on the architecture)
|
||||
* extra bytes in the @p thread_t structure.
|
||||
|
@ -46,7 +46,7 @@
|
|||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_MESSAGES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MESSAGES || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module exported variables. */
|
||||
|
@ -64,7 +64,7 @@
|
|||
/* Module local functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if CH_USE_MESSAGES_PRIORITY
|
||||
#if CH_CFG_USE_MESSAGES_PRIORITY
|
||||
#define msg_insert(tp, qp) prio_insert(tp, qp)
|
||||
#else
|
||||
#define msg_insert(tp, qp) queue_insert(tp, qp)
|
||||
|
@ -147,6 +147,6 @@ void chMsgRelease(thread_t *tp, msg_t msg) {
|
|||
chSysUnlock();
|
||||
}
|
||||
|
||||
#endif /* CH_USE_MESSAGES */
|
||||
#endif /* CH_CFG_USE_MESSAGES */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
* The mechanism works with any number of nested mutexes and any
|
||||
* number of involved threads. The algorithm complexity (worst case)
|
||||
* is N with N equal to the number of nested mutexes.
|
||||
* @pre In order to use the mutex APIs the @p CH_USE_MUTEXES option
|
||||
* @pre In order to use the mutex APIs the @p CH_CFG_USE_MUTEXES option
|
||||
* must be enabled in @p chconf.h.
|
||||
* @post Enabling mutexes requires 5-12 (depending on the architecture)
|
||||
* extra bytes in the @p thread_t structure.
|
||||
|
@ -67,7 +67,7 @@
|
|||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module exported variables. */
|
||||
|
@ -158,16 +158,16 @@ void chMtxLockS(mutex_t *mp) {
|
|||
(threads_queue_t *)tp->p_u.wtobjp);
|
||||
tp = ((mutex_t *)tp->p_u.wtobjp)->m_owner;
|
||||
continue;
|
||||
#if CH_USE_CONDVARS | \
|
||||
(CH_USE_SEMAPHORES && CH_USE_SEMAPHORES_PRIORITY) | \
|
||||
(CH_USE_MESSAGES && CH_USE_MESSAGES_PRIORITY)
|
||||
#if CH_USE_CONDVARS
|
||||
#if CH_CFG_USE_CONDVARS | \
|
||||
(CH_CFG_USE_SEMAPHORES && CH_CFG_USE_SEMAPHORES_PRIORITY) | \
|
||||
(CH_CFG_USE_MESSAGES && CH_CFG_USE_MESSAGES_PRIORITY)
|
||||
#if CH_CFG_USE_CONDVARS
|
||||
case THD_STATE_WTCOND:
|
||||
#endif
|
||||
#if CH_USE_SEMAPHORES && CH_USE_SEMAPHORES_PRIORITY
|
||||
#if CH_CFG_USE_SEMAPHORES && CH_CFG_USE_SEMAPHORES_PRIORITY
|
||||
case THD_STATE_WTSEM:
|
||||
#endif
|
||||
#if CH_USE_MESSAGES && CH_USE_MESSAGES_PRIORITY
|
||||
#if CH_CFG_USE_MESSAGES && CH_CFG_USE_MESSAGES_PRIORITY
|
||||
case THD_STATE_SNDMSGQ:
|
||||
#endif
|
||||
/* Re-enqueues tp with its new priority on the queue.*/
|
||||
|
@ -423,6 +423,6 @@ void chMtxUnlockAll(void) {
|
|||
chSysUnlock();
|
||||
}
|
||||
|
||||
#endif /* CH_USE_MUTEXES */
|
||||
#endif /* CH_CFG_USE_MUTEXES */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -36,14 +36,14 @@
|
|||
* are implemented by pairing an input queue and an output queue
|
||||
* together.
|
||||
* .
|
||||
* @pre In order to use the I/O queues the @p CH_USE_QUEUES option must
|
||||
* @pre In order to use the I/O queues the @p CH_CFG_USE_QUEUES option must
|
||||
* be enabled in @p chconf.h.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_QUEUES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_QUEUES || defined(__DOXYGEN__)
|
||||
|
||||
/**
|
||||
* @brief Puts the invoking thread into the queue's threads queue.
|
||||
|
@ -426,6 +426,6 @@ size_t chOQWriteTimeout(OutputQueue *oqp, const uint8_t *bp,
|
|||
chSysLock();
|
||||
}
|
||||
}
|
||||
#endif /* CH_USE_QUEUES */
|
||||
#endif /* CH_CFG_USE_QUEUES */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -42,13 +42,13 @@
|
|||
* terminating threads can pulse an event source and an event handler
|
||||
* can perform a scansion of the registry in order to recover the
|
||||
* memory.
|
||||
* @pre In order to use the threads registry the @p CH_USE_REGISTRY option
|
||||
* @pre In order to use the threads registry the @p CH_CFG_USE_REGISTRY option
|
||||
* must be enabled in @p chconf.h.
|
||||
* @{
|
||||
*/
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_REGISTRY || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module exported variables. */
|
||||
|
@ -98,12 +98,12 @@ ROMCONST chdebug_t ch_debug = {
|
|||
#endif
|
||||
(uint8_t)_offsetof(thread_t, p_state),
|
||||
(uint8_t)_offsetof(thread_t, p_flags),
|
||||
#if CH_USE_DYNAMIC
|
||||
#if CH_CFG_USE_DYNAMIC
|
||||
(uint8_t)_offsetof(thread_t, p_refs),
|
||||
#else
|
||||
(uint8_t)0,
|
||||
#endif
|
||||
#if CH_TIME_QUANTUM > 0
|
||||
#if CH_CFG_TIME_QUANTUM > 0
|
||||
(uint8_t)_offsetof(thread_t, p_preempt),
|
||||
#else
|
||||
(uint8_t)0,
|
||||
|
@ -132,7 +132,7 @@ thread_t *chRegFirstThread(void) {
|
|||
|
||||
chSysLock();
|
||||
tp = rlist.r_newer;
|
||||
#if CH_USE_DYNAMIC
|
||||
#if CH_CFG_USE_DYNAMIC
|
||||
tp->p_refs++;
|
||||
#endif
|
||||
chSysUnlock();
|
||||
|
@ -157,7 +157,7 @@ thread_t *chRegNextThread(thread_t *tp) {
|
|||
ntp = tp->p_newer;
|
||||
if (ntp == (thread_t *)&rlist)
|
||||
ntp = NULL;
|
||||
#if CH_USE_DYNAMIC
|
||||
#if CH_CFG_USE_DYNAMIC
|
||||
else {
|
||||
chDbgAssert(ntp->p_refs < 255, "chRegNextThread(), #1",
|
||||
"too many references");
|
||||
|
@ -165,12 +165,12 @@ thread_t *chRegNextThread(thread_t *tp) {
|
|||
}
|
||||
#endif
|
||||
chSysUnlock();
|
||||
#if CH_USE_DYNAMIC
|
||||
#if CH_CFG_USE_DYNAMIC
|
||||
chThdRelease(tp);
|
||||
#endif
|
||||
return ntp;
|
||||
}
|
||||
|
||||
#endif /* CH_USE_REGISTRY */
|
||||
#endif /* CH_CFG_USE_REGISTRY */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -67,7 +67,7 @@ void _scheduler_init(void) {
|
|||
|
||||
queue_init(&rlist.r_queue);
|
||||
rlist.r_prio = NOPRIO;
|
||||
#if CH_USE_REGISTRY
|
||||
#if CH_CFG_USE_REGISTRY
|
||||
rlist.r_newer = rlist.r_older = (thread_t *)&rlist;
|
||||
#endif
|
||||
}
|
||||
|
@ -126,10 +126,10 @@ void chSchGoSleepS(tstate_t newstate) {
|
|||
chDbgCheckClassS();
|
||||
|
||||
(otp = currp)->p_state = newstate;
|
||||
#if CH_TIME_QUANTUM > 0
|
||||
#if CH_CFG_TIME_QUANTUM > 0
|
||||
/* The thread is renouncing its remaining time slices so it will have a new
|
||||
time quantum when it will wakeup.*/
|
||||
otp->p_preempt = CH_TIME_QUANTUM;
|
||||
otp->p_preempt = CH_CFG_TIME_QUANTUM;
|
||||
#endif
|
||||
setcurrp(queue_fifo_remove(&rlist.r_queue));
|
||||
currp->p_state = THD_STATE_CURRENT;
|
||||
|
@ -149,17 +149,17 @@ static void wakeup(void *p) {
|
|||
another thread with higher priority.*/
|
||||
chSysUnlockFromIsr();
|
||||
return;
|
||||
#if CH_USE_SEMAPHORES || CH_USE_QUEUES || \
|
||||
(CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT)
|
||||
#if CH_USE_SEMAPHORES
|
||||
#if CH_CFG_USE_SEMAPHORES || CH_CFG_USE_QUEUES || \
|
||||
(CH_CFG_USE_CONDVARS && CH_CFG_USE_CONDVARS_TIMEOUT)
|
||||
#if CH_CFG_USE_SEMAPHORES
|
||||
case THD_STATE_WTSEM:
|
||||
chSemFastSignalI((semaphore_t *)tp->p_u.wtobjp);
|
||||
/* Falls into, intentional. */
|
||||
#endif
|
||||
#if CH_USE_QUEUES
|
||||
#if CH_CFG_USE_QUEUES
|
||||
case THD_STATE_WTQUEUE:
|
||||
#endif
|
||||
#if CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT
|
||||
#if CH_CFG_USE_CONDVARS && CH_CFG_USE_CONDVARS_TIMEOUT
|
||||
case THD_STATE_WTCOND:
|
||||
#endif
|
||||
/* States requiring dequeuing.*/
|
||||
|
@ -276,7 +276,7 @@ void chSchRescheduleS(void) {
|
|||
bool chSchIsPreemptionRequired(void) {
|
||||
tprio_t p1 = firstprio(&rlist.r_queue);
|
||||
tprio_t p2 = currp->p_prio;
|
||||
#if CH_TIME_QUANTUM > 0
|
||||
#if CH_CFG_TIME_QUANTUM > 0
|
||||
/* If the running thread has not reached its time quantum, reschedule only
|
||||
if the first thread on the ready queue has a higher priority.
|
||||
Otherwise, if the running thread has used up its time quantum, reschedule
|
||||
|
@ -306,8 +306,8 @@ void chSchDoRescheduleBehind(void) {
|
|||
/* Picks the first thread from the ready queue and makes it current.*/
|
||||
setcurrp(queue_fifo_remove(&rlist.r_queue));
|
||||
currp->p_state = THD_STATE_CURRENT;
|
||||
#if CH_TIME_QUANTUM > 0
|
||||
otp->p_preempt = CH_TIME_QUANTUM;
|
||||
#if CH_CFG_TIME_QUANTUM > 0
|
||||
otp->p_preempt = CH_CFG_TIME_QUANTUM;
|
||||
#endif
|
||||
chSchReadyI(otp);
|
||||
chSysSwitch(currp, otp);
|
||||
|
@ -355,8 +355,8 @@ void chSchDoRescheduleAhead(void) {
|
|||
*/
|
||||
void chSchDoReschedule(void) {
|
||||
|
||||
#if CH_TIME_QUANTUM > 0
|
||||
/* If CH_TIME_QUANTUM is enabled then there are two different scenarios to
|
||||
#if CH_CFG_TIME_QUANTUM > 0
|
||||
/* If CH_CFG_TIME_QUANTUM is enabled then there are two different scenarios to
|
||||
handle on preemption: time quantum elapsed or not.*/
|
||||
if (currp->p_preempt == 0) {
|
||||
/* The thread consumed its time quantum so it is enqueued behind threads
|
||||
|
@ -368,11 +368,11 @@ void chSchDoReschedule(void) {
|
|||
threads with equal priority and does not acquire a new time quantum.*/
|
||||
chSchDoRescheduleAhead();
|
||||
}
|
||||
#else /* !(CH_TIME_QUANTUM > 0) */
|
||||
#else /* !(CH_CFG_TIME_QUANTUM > 0) */
|
||||
/* If the round-robin mechanism is disabled then the thread goes always
|
||||
ahead of its peers.*/
|
||||
chSchDoRescheduleAhead();
|
||||
#endif /* !(CH_TIME_QUANTUM > 0) */
|
||||
#endif /* !(CH_CFG_TIME_QUANTUM > 0) */
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -51,15 +51,15 @@
|
|||
* also have other uses, queues guards and counters for example.<br>
|
||||
* Semaphores usually use a FIFO queuing strategy but it is possible
|
||||
* to make them order threads by priority by enabling
|
||||
* @p CH_USE_SEMAPHORES_PRIORITY in @p chconf.h.
|
||||
* @pre In order to use the semaphore APIs the @p CH_USE_SEMAPHORES
|
||||
* @p CH_CFG_USE_SEMAPHORES_PRIORITY in @p chconf.h.
|
||||
* @pre In order to use the semaphore APIs the @p CH_CFG_USE_SEMAPHORES
|
||||
* option must be enabled in @p chconf.h.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_SEMAPHORES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module exported variables. */
|
||||
|
@ -77,7 +77,7 @@
|
|||
/* Module local functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if CH_USE_SEMAPHORES_PRIORITY
|
||||
#if CH_CFG_USE_SEMAPHORES_PRIORITY
|
||||
#define sem_insert(tp, qp) prio_insert(tp, qp)
|
||||
#else
|
||||
#define sem_insert(tp, qp) queue_insert(tp, qp)
|
||||
|
@ -360,11 +360,8 @@ void chSemAddCounterI(semaphore_t *sp, cnt_t n) {
|
|||
}
|
||||
}
|
||||
|
||||
#if CH_USE_SEMSW
|
||||
/**
|
||||
* @brief Performs atomic signal and wait operations on two semaphores.
|
||||
* @pre The configuration option @p CH_USE_SEMSW must be enabled in order
|
||||
* to use this function.
|
||||
*
|
||||
* @param[in] sps pointer to a @p semaphore_t structure to be signaled
|
||||
* @param[in] spw pointer to a @p semaphore_t structure to wait on
|
||||
|
@ -406,8 +403,7 @@ msg_t chSemSignalWait(semaphore_t *sps, semaphore_t *spw) {
|
|||
chSysUnlock();
|
||||
return msg;
|
||||
}
|
||||
#endif /* CH_USE_SEMSW */
|
||||
|
||||
#endif /* CH_USE_SEMAPHORES */
|
||||
#endif /* CH_CFG_USE_SEMAPHORES */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -47,18 +47,18 @@
|
|||
/* Module local variables. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !CH_NO_IDLE_THREAD || defined(__DOXYGEN__)
|
||||
#if !CH_CFG_NO_IDLE_THREAD || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Idle thread working area.
|
||||
*/
|
||||
static WORKING_AREA(_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE);
|
||||
#endif /* CH_NO_IDLE_THREAD */
|
||||
#endif /* CH_CFG_NO_IDLE_THREAD */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module local functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#if !CH_NO_IDLE_THREAD || defined(__DOXYGEN__)
|
||||
#if !CH_CFG_NO_IDLE_THREAD || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief This function implements the idle thread infinite loop.
|
||||
* @details The function puts the processor in the lowest power mode capable
|
||||
|
@ -75,10 +75,10 @@ static void _idle_thread(void *p) {
|
|||
chRegSetThreadName("idle");
|
||||
while (true) {
|
||||
port_wait_for_interrupt();
|
||||
IDLE_LOOP_HOOK();
|
||||
CH_CFG_IDLE_LOOP_HOOK();
|
||||
}
|
||||
}
|
||||
#endif /* CH_NO_IDLE_THREAD */
|
||||
#endif /* CH_CFG_NO_IDLE_THREAD */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module exported functions. */
|
||||
|
@ -105,10 +105,10 @@ void chSysInit(void) {
|
|||
port_init();
|
||||
_scheduler_init();
|
||||
_vt_init();
|
||||
#if CH_USE_MEMCORE
|
||||
#if CH_CFG_USE_MEMCORE
|
||||
_core_init();
|
||||
#endif
|
||||
#if CH_USE_HEAP
|
||||
#if CH_CFG_USE_HEAP
|
||||
_heap_init();
|
||||
#endif
|
||||
#if CH_DBG_ENABLE_TRACE
|
||||
|
@ -129,7 +129,7 @@ void chSysInit(void) {
|
|||
active, else the parameter is ignored.*/
|
||||
chRegSetThreadName((const char *)&ch_debug);
|
||||
|
||||
#if !CH_NO_IDLE_THREAD
|
||||
#if !CH_CFG_NO_IDLE_THREAD
|
||||
/* This thread has the lowest priority in the system, its role is just to
|
||||
serve interrupts in its context while keeping the lowest energy saving
|
||||
mode compatible with the system status.*/
|
||||
|
@ -152,8 +152,8 @@ void chSysHalt(void) {
|
|||
|
||||
chSysDisable();
|
||||
|
||||
#if defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
|
||||
SYSTEM_HALT_HOOK();
|
||||
#if defined(CH_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
|
||||
CH_CFG_SYSTEM_HALT_HOOK();
|
||||
#endif
|
||||
|
||||
/* Harmless infinite loop.*/
|
||||
|
@ -167,7 +167,7 @@ void chSysHalt(void) {
|
|||
* and preempts it when the quantum is used up. Increments system
|
||||
* time and manages the timers.
|
||||
* @note The frequency of the timer determines the system tick granularity
|
||||
* and, together with the @p CH_TIME_QUANTUM macro, the round robin
|
||||
* and, together with the @p CH_CFG_TIME_QUANTUM macro, the round robin
|
||||
* interval.
|
||||
*
|
||||
* @iclass
|
||||
|
@ -176,7 +176,7 @@ void chSysTimerHandlerI(void) {
|
|||
|
||||
chDbgCheckClassI();
|
||||
|
||||
#if CH_TIME_QUANTUM > 0
|
||||
#if CH_CFG_TIME_QUANTUM > 0
|
||||
/* Running thread has not used up quantum yet? */
|
||||
if (currp->p_preempt > 0)
|
||||
/* Decrement remaining quantum.*/
|
||||
|
@ -186,8 +186,8 @@ void chSysTimerHandlerI(void) {
|
|||
currp->p_time++;
|
||||
#endif
|
||||
chVTDoTickI();
|
||||
#if defined(SYSTEM_TICK_EVENT_HOOK)
|
||||
SYSTEM_TICK_EVENT_HOOK();
|
||||
#if defined(CH_CFG_SYSTEM_TICK_HOOK)
|
||||
CH_CFG_SYSTEM_TICK_HOOK();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
* .
|
||||
* The threads subsystem is implicitly included in kernel however
|
||||
* some of its part may be excluded by disabling them in @p chconf.h,
|
||||
* see the @p CH_USE_WAITEXIT and @p CH_USE_DYNAMIC configuration
|
||||
* see the @p CH_CFG_USE_WAITEXIT and @p CH_CFG_USE_DYNAMIC configuration
|
||||
* options.
|
||||
* @{
|
||||
*/
|
||||
|
@ -95,37 +95,37 @@ thread_t *_thread_init(thread_t *tp, tprio_t prio) {
|
|||
tp->p_prio = prio;
|
||||
tp->p_state = THD_STATE_SUSPENDED;
|
||||
tp->p_flags = THD_MEM_MODE_STATIC;
|
||||
#if CH_TIME_QUANTUM > 0
|
||||
tp->p_preempt = CH_TIME_QUANTUM;
|
||||
#if CH_CFG_TIME_QUANTUM > 0
|
||||
tp->p_preempt = CH_CFG_TIME_QUANTUM;
|
||||
#endif
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
tp->p_realprio = prio;
|
||||
tp->p_mtxlist = NULL;
|
||||
#endif
|
||||
#if CH_USE_EVENTS
|
||||
#if CH_CFG_USE_EVENTS
|
||||
tp->p_epending = 0;
|
||||
#endif
|
||||
#if CH_DBG_THREADS_PROFILING
|
||||
tp->p_time = 0;
|
||||
#endif
|
||||
#if CH_USE_DYNAMIC
|
||||
#if CH_CFG_USE_DYNAMIC
|
||||
tp->p_refs = 1;
|
||||
#endif
|
||||
#if CH_USE_REGISTRY
|
||||
#if CH_CFG_USE_REGISTRY
|
||||
tp->p_name = NULL;
|
||||
REG_INSERT(tp);
|
||||
#endif
|
||||
#if CH_USE_WAITEXIT
|
||||
#if CH_CFG_USE_WAITEXIT
|
||||
list_init(&tp->p_waiting);
|
||||
#endif
|
||||
#if CH_USE_MESSAGES
|
||||
#if CH_CFG_USE_MESSAGES
|
||||
queue_init(&tp->p_msgqueue);
|
||||
#endif
|
||||
#if CH_DBG_ENABLE_STACK_CHECK
|
||||
tp->p_stklimit = (stkalign_t *)(tp + 1);
|
||||
#endif
|
||||
#if defined(THREAD_EXT_INIT_HOOK)
|
||||
THREAD_EXT_INIT_HOOK(tp);
|
||||
#if defined(CH_CFG_THREAD_INIT_HOOK)
|
||||
CH_CFG_THREAD_INIT_HOOK(tp);
|
||||
#endif
|
||||
return tp;
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ tprio_t chThdSetPriority(tprio_t newprio) {
|
|||
chDbgCheck(newprio <= HIGHPRIO, "chThdSetPriority");
|
||||
|
||||
chSysLock();
|
||||
#if CH_USE_MUTEXES
|
||||
#if CH_CFG_USE_MUTEXES
|
||||
oldprio = currp->p_realprio;
|
||||
if ((currp->p_prio == currp->p_realprio) || (newprio > currp->p_prio))
|
||||
currp->p_prio = newprio;
|
||||
|
@ -385,14 +385,14 @@ void chThdExitS(msg_t msg) {
|
|||
thread_t *tp = currp;
|
||||
|
||||
tp->p_u.exitcode = msg;
|
||||
#if defined(THREAD_EXT_EXIT_HOOK)
|
||||
THREAD_EXT_EXIT_HOOK(tp);
|
||||
#if defined(CH_CFG_THREAD_EXIT_HOOK)
|
||||
CH_CFG_THREAD_EXIT_HOOK(tp);
|
||||
#endif
|
||||
#if CH_USE_WAITEXIT
|
||||
#if CH_CFG_USE_WAITEXIT
|
||||
while (list_notempty(&tp->p_waiting))
|
||||
chSchReadyI(list_remove(&tp->p_waiting));
|
||||
#endif
|
||||
#if CH_USE_REGISTRY
|
||||
#if CH_CFG_USE_REGISTRY
|
||||
/* Static threads are immediately removed from the registry because
|
||||
there is no memory to recover.*/
|
||||
if ((tp->p_flags & THD_MEM_MODE_MASK) == THD_MEM_MODE_STATIC)
|
||||
|
@ -403,7 +403,7 @@ void chThdExitS(msg_t msg) {
|
|||
chDbgAssert(false, "chThdExitS(), #1", "zombies apocalypse");
|
||||
}
|
||||
|
||||
#if CH_USE_WAITEXIT || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_WAITEXIT || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Blocks the execution of the invoking thread until the specified
|
||||
* thread terminates then the exit code is returned.
|
||||
|
@ -421,13 +421,13 @@ void chThdExitS(msg_t msg) {
|
|||
* - If the thread was spawned by @p chThdCreateFromMemoryPool()
|
||||
* then the working area is returned to the owning memory pool.
|
||||
* .
|
||||
* @pre The configuration option @p CH_USE_WAITEXIT must be enabled in
|
||||
* @pre The configuration option @p CH_CFG_USE_WAITEXIT must be enabled in
|
||||
* order to use this function.
|
||||
* @post Enabling @p chThdWait() requires 2-4 (depending on the
|
||||
* architecture) extra bytes in the @p thread_t structure.
|
||||
* @post After invoking @p chThdWait() the thread pointer becomes invalid
|
||||
* and must not be used as parameter for further system calls.
|
||||
* @note If @p CH_USE_DYNAMIC is not specified this function just waits for
|
||||
* @note If @p CH_CFG_USE_DYNAMIC is not specified this function just waits for
|
||||
* the thread termination, no memory allocators are involved.
|
||||
*
|
||||
* @param[in] tp pointer to the thread
|
||||
|
@ -442,7 +442,7 @@ msg_t chThdWait(thread_t *tp) {
|
|||
|
||||
chSysLock();
|
||||
chDbgAssert(tp != currp, "chThdWait(), #1", "waiting self");
|
||||
#if CH_USE_DYNAMIC
|
||||
#if CH_CFG_USE_DYNAMIC
|
||||
chDbgAssert(tp->p_refs > 0, "chThdWait(), #2", "not referenced");
|
||||
#endif
|
||||
if (tp->p_state != THD_STATE_FINAL) {
|
||||
|
@ -451,11 +451,11 @@ msg_t chThdWait(thread_t *tp) {
|
|||
}
|
||||
msg = tp->p_u.exitcode;
|
||||
chSysUnlock();
|
||||
#if CH_USE_DYNAMIC
|
||||
#if CH_CFG_USE_DYNAMIC
|
||||
chThdRelease(tp);
|
||||
#endif
|
||||
return msg;
|
||||
}
|
||||
#endif /* CH_USE_WAITEXIT */
|
||||
#endif /* CH_CFG_USE_WAITEXIT */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
* @details Frequency of the system timer that drives the system ticks. This
|
||||
* setting also defines the system tick time unit.
|
||||
*/
|
||||
#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__)
|
||||
#define CH_FREQUENCY 1000
|
||||
#if !defined(CH_CFG_FREQUENCY) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_FREQUENCY 1000
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -55,12 +55,25 @@
|
|||
* disables the preemption for threads with equal priority and the
|
||||
* round robin becomes cooperative. Note that higher priority
|
||||
* threads can still preempt, the kernel is always preemptive.
|
||||
*
|
||||
* @note Disabling the round robin preemption makes the kernel more compact
|
||||
* and generally faster.
|
||||
* @note The round robin preemption is not supported in tickless mode and
|
||||
* must be set to zero in that case.
|
||||
*/
|
||||
#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__)
|
||||
#define CH_TIME_QUANTUM 20
|
||||
#if !defined(CH_CFG_TIME_QUANTUM) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_TIME_QUANTUM 20
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Time delta constant for the tick-less mode.
|
||||
* @note If this value is zero then the system uses the classic
|
||||
* periodic tick. This value represents the minimum number
|
||||
* of ticks that is safe to specify in a timeout directive.
|
||||
* The value one is not valid, timeouts are rounded up to
|
||||
* this value.
|
||||
*/
|
||||
#if !defined(CH_CFG_TIMEDELTA) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_TIMEDELTA 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -72,10 +85,10 @@
|
|||
*
|
||||
* @note In order to let the OS manage the whole RAM the linker script must
|
||||
* provide the @p __heap_base__ and @p __heap_end__ symbols.
|
||||
* @note Requires @p CH_USE_MEMCORE.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE.
|
||||
*/
|
||||
#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__)
|
||||
#define CH_MEMCORE_SIZE 0
|
||||
#if !defined(CH_CFG_MEMCORE_SIZE) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_MEMCORE_SIZE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -91,8 +104,8 @@
|
|||
* @note Unless an idle thread is spawned the @p main() thread must not
|
||||
* enter a sleep state.
|
||||
*/
|
||||
#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__)
|
||||
#define CH_NO_IDLE_THREAD FALSE
|
||||
#if !defined(CH_CFG_NO_IDLE_THREAD) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_NO_IDLE_THREAD FALSE
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
@ -112,8 +125,8 @@
|
|||
* @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
|
||||
#if !defined(CH_CFG_OPTIMIZE_SPEED) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_OPTIMIZE_SPEED TRUE
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
@ -131,8 +144,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__)
|
||||
#define CH_USE_REGISTRY TRUE
|
||||
#if !defined(CH_CFG_USE_REGISTRY) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_REGISTRY TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -142,8 +155,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__)
|
||||
#define CH_USE_WAITEXIT TRUE
|
||||
#if !defined(CH_CFG_USE_WAITEXIT) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_WAITEXIT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -152,8 +165,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__)
|
||||
#define CH_USE_SEMAPHORES TRUE
|
||||
#if !defined(CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_SEMAPHORES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -161,23 +174,12 @@
|
|||
* @details If enabled then the threads are enqueued on semaphores by
|
||||
* priority rather than in FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special requirements.
|
||||
* @note Requires @p CH_USE_SEMAPHORES.
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__)
|
||||
#define CH_USE_SEMAPHORES_PRIORITY FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Atomic semaphore API.
|
||||
* @details If enabled then the semaphores the @p chSemSignalWait() API
|
||||
* is included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_SEMAPHORES.
|
||||
*/
|
||||
#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__)
|
||||
#define CH_USE_SEMSW TRUE
|
||||
#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -186,8 +188,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MUTEXES TRUE
|
||||
#if !defined(CH_CFG_USE_MUTEXES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MUTEXES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -196,10 +198,10 @@
|
|||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_MUTEXES.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__)
|
||||
#define CH_USE_CONDVARS TRUE
|
||||
#if !defined(CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_CONDVARS TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -208,10 +210,10 @@
|
|||
* specification are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_CONDVARS.
|
||||
* @note Requires @p CH_CFG_USE_CONDVARS.
|
||||
*/
|
||||
#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__)
|
||||
#define CH_USE_CONDVARS_TIMEOUT TRUE
|
||||
#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -220,8 +222,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__)
|
||||
#define CH_USE_EVENTS TRUE
|
||||
#if !defined(CH_CFG_USE_EVENTS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_EVENTS TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -230,10 +232,10 @@
|
|||
* are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_EVENTS.
|
||||
* @note Requires @p CH_CFG_USE_EVENTS.
|
||||
*/
|
||||
#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
|
||||
#define CH_USE_EVENTS_TIMEOUT TRUE
|
||||
#if !defined(CH_CFG_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -243,8 +245,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MESSAGES TRUE
|
||||
#if !defined(CH_CFG_USE_MESSAGES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MESSAGES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -252,11 +254,12 @@
|
|||
* @details If enabled then messages are served by priority rather than in
|
||||
* FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special requirements.
|
||||
* @note Requires @p CH_USE_MESSAGES.
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_MESSAGES.
|
||||
*/
|
||||
#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MESSAGES_PRIORITY FALSE
|
||||
#if !defined(CH_CFG_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -265,10 +268,10 @@
|
|||
* included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_SEMAPHORES.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MAILBOXES TRUE
|
||||
#if !defined(CH_CFG_USE_MAILBOXES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MAILBOXES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -277,8 +280,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__)
|
||||
#define CH_USE_QUEUES TRUE
|
||||
#if !defined(CH_CFG_USE_QUEUES) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_QUEUES TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -288,8 +291,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MEMCORE TRUE
|
||||
#if !defined(CH_CFG_USE_MEMCORE) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MEMCORE TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -298,12 +301,12 @@
|
|||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or
|
||||
* @p CH_USE_SEMAPHORES.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
|
||||
* @p CH_CFG_USE_SEMAPHORES.
|
||||
* @note Mutexes are recommended.
|
||||
*/
|
||||
#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__)
|
||||
#define CH_USE_HEAP TRUE
|
||||
#if !defined(CH_CFG_USE_HEAP) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_HEAP TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -313,8 +316,8 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__)
|
||||
#define CH_USE_MEMPOOLS TRUE
|
||||
#if !defined(CH_CFG_USE_MEMPOOLS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_MEMPOOLS TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -323,11 +326,11 @@
|
|||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_USE_WAITEXIT.
|
||||
* @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS.
|
||||
* @note Requires @p CH_CFG_USE_WAITEXIT.
|
||||
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
|
||||
*/
|
||||
#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__)
|
||||
#define CH_USE_DYNAMIC TRUE
|
||||
#if !defined(CH_CFG_USE_DYNAMIC) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_USE_DYNAMIC TRUE
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
@ -347,7 +350,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_SYSTEM_STATE_CHECK) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -358,7 +361,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_CHECKS FALSE
|
||||
#define CH_DBG_ENABLE_CHECKS FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -370,7 +373,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_ASSERTS FALSE
|
||||
#define CH_DBG_ENABLE_ASSERTS FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -381,7 +384,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_TRACE FALSE
|
||||
#define CH_DBG_ENABLE_TRACE FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -395,7 +398,7 @@
|
|||
* @p panic_msg variable set to @p NULL.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||||
#define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -407,7 +410,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_FILL_THREADS FALSE
|
||||
#define CH_DBG_FILL_THREADS FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -420,7 +423,7 @@
|
|||
* some test cases into the test suite.
|
||||
*/
|
||||
#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_THREADS_PROFILING TRUE
|
||||
#define CH_DBG_THREADS_PROFILING TRUE
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
@ -436,8 +439,8 @@
|
|||
* @brief Threads descriptor structure extension.
|
||||
* @details User fields added to the end of the @p thread_t structure.
|
||||
*/
|
||||
#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__)
|
||||
#define THREAD_EXT_FIELDS \
|
||||
#if !defined(CH_CFG_THREAD_EXTRA_FIELDS) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_THREAD_EXTRA_FIELDS \
|
||||
/* Add threads custom fields here.*/
|
||||
#endif
|
||||
|
||||
|
@ -448,8 +451,8 @@
|
|||
* @note It is invoked from within @p chThdInit() and implicitly from all
|
||||
* the threads creation APIs.
|
||||
*/
|
||||
#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__)
|
||||
#define THREAD_EXT_INIT_HOOK(tp) { \
|
||||
#if !defined(CH_CFG_THREAD_INIT_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_THREAD_INIT_HOOK(tp) { \
|
||||
/* Add threads initialization code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
@ -462,8 +465,8 @@
|
|||
* @note It is also invoked when the threads simply return in order to
|
||||
* terminate.
|
||||
*/
|
||||
#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__)
|
||||
#define THREAD_EXT_EXIT_HOOK(tp) { \
|
||||
#if !defined(CH_CFG_THREAD_EXIT_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
|
||||
/* Add threads finalization code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
@ -472,8 +475,8 @@
|
|||
* @brief Context switch hook.
|
||||
* @details This hook is invoked just before switching between threads.
|
||||
*/
|
||||
#if !defined(THREAD_CONTEXT_SWITCH_HOOK) || defined(__DOXYGEN__)
|
||||
#define THREAD_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
||||
#if !defined(CH_CFG_CONTEXT_SWITCH_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
||||
/* System halt code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
@ -482,8 +485,8 @@
|
|||
* @brief Idle Loop hook.
|
||||
* @details This hook is continuously invoked by the idle thread loop.
|
||||
*/
|
||||
#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__)
|
||||
#define IDLE_LOOP_HOOK() { \
|
||||
#if !defined(CH_CFG_IDLE_LOOP_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_IDLE_LOOP_HOOK() { \
|
||||
/* Idle loop code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
@ -493,8 +496,8 @@
|
|||
* @details This hook is invoked in the system tick handler immediately
|
||||
* after processing the virtual timers queue.
|
||||
*/
|
||||
#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__)
|
||||
#define SYSTEM_TICK_EVENT_HOOK() { \
|
||||
#if !defined(CH_CFG_SYSTEM_TICK_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_SYSTEM_TICK_HOOK() { \
|
||||
/* System tick event code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
@ -504,8 +507,8 @@
|
|||
* @details This hook is invoked in case to a system halting error before
|
||||
* the system is halted.
|
||||
*/
|
||||
#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
|
||||
#define SYSTEM_HALT_HOOK() { \
|
||||
#if !defined(CH_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_SYSTEM_HALT_HOOK() { \
|
||||
/* System halt code here.*/ \
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -42,11 +42,6 @@
|
|||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Boolean, recommended the fastest signed.
|
||||
*/
|
||||
typedef int32_t bool_t;
|
||||
|
||||
/**
|
||||
* @brief Thread mode flags, uint8_t is ok.
|
||||
*/
|
||||
|
@ -97,39 +92,6 @@ typedef uint32_t systime_t;
|
|||
*/
|
||||
typedef int32_t cnt_t;
|
||||
|
||||
/**
|
||||
* @brief Inline function modifier.
|
||||
*/
|
||||
#define INLINE inline
|
||||
|
||||
/**
|
||||
* @brief ROM constant modifier.
|
||||
* @note This is required because some compilers require a custom keyword,
|
||||
* usually this macro is just set to "const" for the GCC compiler.
|
||||
* @note This macro is not used to place constants in different address
|
||||
* spaces (like AVR requires for example) because it is assumed that
|
||||
* a pointer to a ROMCONST constant is compatible with a pointer
|
||||
* to a normal variable. It is just like the "const" keyword but
|
||||
* requires that the constant is placed in ROM if the architecture
|
||||
* supports it.
|
||||
*/
|
||||
#define ROMCONST const
|
||||
|
||||
/**
|
||||
* @brief Packed structure modifier (within).
|
||||
*/
|
||||
#define PACK_STRUCT_STRUCT __attribute__((packed))
|
||||
|
||||
/**
|
||||
* @brief Packed structure modifier (before).
|
||||
*/
|
||||
#define PACK_STRUCT_BEGIN
|
||||
|
||||
/**
|
||||
* @brief Packed structure modifier (after).
|
||||
*/
|
||||
#define PACK_STRUCT_END
|
||||
|
||||
#endif /* _CHTYPES_H_ */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_XXX || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_XXX || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module local definitions. */
|
||||
|
@ -76,6 +76,6 @@ void chXxxObjectInit(xxx_t *xxxp) {
|
|||
|
||||
}
|
||||
|
||||
#endif /* CH_USE_XXX */
|
||||
#endif /* CH_CFG_USE_XXX */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include "ch.h"
|
||||
|
||||
#if CH_USE_XXX || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_XXX || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module constants. */
|
||||
|
@ -70,7 +70,7 @@ extern "C" {
|
|||
/* Module inline functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CH_USE_XXX */
|
||||
#endif /* CH_CFG_USE_XXX */
|
||||
|
||||
#endif /* _CHXXX_H_ */
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
*/
|
||||
|
||||
static semaphore_t sem1;
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
static mutex_t mtx1;
|
||||
#endif
|
||||
|
||||
|
@ -575,7 +575,7 @@ ROMCONST struct testcase testbmk11 = {
|
|||
bmk11_execute
|
||||
};
|
||||
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @page test_benchmarks_012 Mutexes lock/unlock performance
|
||||
*
|
||||
|
@ -648,7 +648,7 @@ static void bmk13_execute(void) {
|
|||
test_print("--- Semaph: ");
|
||||
test_printn(sizeof(semaphore_t));
|
||||
test_println(" bytes");
|
||||
#if CH_USE_EVENTS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
|
||||
test_print("--- EventS: ");
|
||||
test_printn(sizeof(event_source_t));
|
||||
test_println(" bytes");
|
||||
|
@ -656,22 +656,22 @@ static void bmk13_execute(void) {
|
|||
test_printn(sizeof(event_listener_t));
|
||||
test_println(" bytes");
|
||||
#endif
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
test_print("--- Mutex : ");
|
||||
test_printn(sizeof(mutex_t));
|
||||
test_println(" bytes");
|
||||
#endif
|
||||
#if CH_USE_CONDVARS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
|
||||
test_print("--- CondV.: ");
|
||||
test_printn(sizeof(condition_variable_t));
|
||||
test_println(" bytes");
|
||||
#endif
|
||||
#if CH_USE_QUEUES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_QUEUES || defined(__DOXYGEN__)
|
||||
test_print("--- Queue : ");
|
||||
test_printn(sizeof(GenericQueue));
|
||||
test_println(" bytes");
|
||||
#endif
|
||||
#if CH_USE_MAILBOXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MAILBOXES || defined(__DOXYGEN__)
|
||||
test_print("--- MailB.: ");
|
||||
test_printn(sizeof(mailbox_t));
|
||||
test_println(" bytes");
|
||||
|
@ -701,7 +701,7 @@ ROMCONST struct testcase * ROMCONST patternbmk[] = {
|
|||
&testbmk9,
|
||||
&testbmk10,
|
||||
&testbmk11,
|
||||
#if CH_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
|
||||
&testbmk12,
|
||||
#endif
|
||||
&testbmk13,
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
*
|
||||
* <h2>Preconditions</h2>
|
||||
* The module requires the following kernel options:
|
||||
* - @p CH_USE_DYNAMIC
|
||||
* - @p CH_USE_HEAP
|
||||
* - @p CH_USE_MEMPOOLS
|
||||
* - @p CH_CFG_USE_DYNAMIC
|
||||
* - @p CH_CFG_USE_HEAP
|
||||
* - @p CH_CFG_USE_MEMPOOLS
|
||||
* .
|
||||
* In case some of the required options are not enabled then some or all tests
|
||||
* may be skipped.
|
||||
|
@ -49,11 +49,11 @@
|
|||
* @brief Dynamic thread APIs test header file
|
||||
*/
|
||||
|
||||
#if CH_USE_DYNAMIC || defined(__DOXYGEN__)
|
||||
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_DYNAMIC || defined(__DOXYGEN__)
|
||||
#if (CH_CFG_USE_HEAP && !CH_CFG_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
|
||||
static memory_heap_t heap1;
|
||||
#endif
|
||||
#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
static memory_pool_t mp1;
|
||||
#endif
|
||||
|
||||
|
@ -74,7 +74,7 @@ static msg_t thread(void *p) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
|
||||
#if (CH_CFG_USE_HEAP && !CH_CFG_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
|
||||
static void dyn1_setup(void) {
|
||||
|
||||
chHeapObjectInit(&heap1, test.buffer, sizeof(union test_buffers));
|
||||
|
@ -120,9 +120,9 @@ ROMCONST struct testcase testdyn1 = {
|
|||
NULL,
|
||||
dyn1_execute
|
||||
};
|
||||
#endif /* (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) */
|
||||
#endif /* (CH_CFG_USE_HEAP && !CH_CFG_USE_MALLOC_HEAP) */
|
||||
|
||||
#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @page test_dynamic_002 Threads creation from Memory Pool
|
||||
*
|
||||
|
@ -176,9 +176,9 @@ ROMCONST struct testcase testdyn2 = {
|
|||
NULL,
|
||||
dyn2_execute
|
||||
};
|
||||
#endif /* CH_USE_MEMPOOLS */
|
||||
#endif /* CH_CFG_USE_MEMPOOLS */
|
||||
|
||||
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP && CH_USE_REGISTRY) || \
|
||||
#if (CH_CFG_USE_HEAP && !CH_CFG_USE_MALLOC_HEAP && CH_CFG_USE_REGISTRY) || \
|
||||
defined(__DOXYGEN__)
|
||||
/**
|
||||
* @page test_dynamic_003 Registry and References test
|
||||
|
@ -241,21 +241,21 @@ ROMCONST struct testcase testdyn3 = {
|
|||
NULL,
|
||||
dyn3_execute
|
||||
};
|
||||
#endif /* CH_USE_HEAP && CH_USE_REGISTRY */
|
||||
#endif /* CH_USE_DYNAMIC */
|
||||
#endif /* CH_CFG_USE_HEAP && CH_CFG_USE_REGISTRY */
|
||||
#endif /* CH_CFG_USE_DYNAMIC */
|
||||
|
||||
/**
|
||||
* @brief Test sequence for dynamic APIs.
|
||||
*/
|
||||
ROMCONST struct testcase * ROMCONST patterndyn[] = {
|
||||
#if CH_USE_DYNAMIC || defined(__DOXYGEN__)
|
||||
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_DYNAMIC || defined(__DOXYGEN__)
|
||||
#if (CH_CFG_USE_HEAP && !CH_CFG_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
|
||||
&testdyn1,
|
||||
#endif
|
||||
#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
&testdyn2,
|
||||
#endif
|
||||
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP && CH_USE_REGISTRY) || \
|
||||
#if (CH_CFG_USE_HEAP && !CH_CFG_USE_MALLOC_HEAP && CH_CFG_USE_REGISTRY) || \
|
||||
defined(__DOXYGEN__)
|
||||
&testdyn3,
|
||||
#endif
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
*
|
||||
* <h2>Preconditions</h2>
|
||||
* The module requires the following kernel options:
|
||||
* - @p CH_USE_EVENTS
|
||||
* - @p CH_USE_EVENTS_TIMEOUT
|
||||
* - @p CH_CFG_USE_EVENTS
|
||||
* - @p CH_CFG_USE_EVENTS_TIMEOUT
|
||||
* .
|
||||
* In case some of the required options are not enabled then some or all tests
|
||||
* may be skipped.
|
||||
|
@ -47,7 +47,7 @@
|
|||
* @brief Events test header file
|
||||
*/
|
||||
|
||||
#if CH_USE_EVENTS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
|
||||
|
||||
#define ALLOWED_DELAY MS2ST(5)
|
||||
|
||||
|
@ -228,7 +228,7 @@ ROMCONST struct testcase testevt2 = {
|
|||
evt2_execute
|
||||
};
|
||||
|
||||
#if CH_USE_EVENTS_TIMEOUT || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS_TIMEOUT || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @page test_events_003 Events timeout
|
||||
*
|
||||
|
@ -275,20 +275,20 @@ ROMCONST struct testcase testevt3 = {
|
|||
NULL,
|
||||
evt3_execute
|
||||
};
|
||||
#endif /* CH_USE_EVENTS_TIMEOUT */
|
||||
#endif /* CH_CFG_USE_EVENTS_TIMEOUT */
|
||||
|
||||
/**
|
||||
* @brief Test sequence for events.
|
||||
*/
|
||||
ROMCONST struct testcase * ROMCONST patternevt[] = {
|
||||
#if CH_USE_EVENTS || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
|
||||
&testevt1,
|
||||
&testevt2,
|
||||
#if CH_USE_EVENTS_TIMEOUT || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_EVENTS_TIMEOUT || defined(__DOXYGEN__)
|
||||
&testevt3,
|
||||
#endif
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
#endif /* CH_USE_EVENTS */
|
||||
#endif /* CH_CFG_USE_EVENTS */
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* <h2>Preconditions</h2>
|
||||
* The module requires the following kernel options:
|
||||
* - @p CH_USE_HEAP
|
||||
* - @p CH_CFG_USE_HEAP
|
||||
* .
|
||||
* In case some of the required options are not enabled then some or all tests
|
||||
* may be skipped.
|
||||
|
@ -44,7 +44,7 @@
|
|||
* @brief Heap header file
|
||||
*/
|
||||
|
||||
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
|
||||
#if (CH_CFG_USE_HEAP && !CH_CFG_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
|
||||
|
||||
#define SIZE 16
|
||||
|
||||
|
@ -146,13 +146,13 @@ ROMCONST struct testcase testheap1 = {
|
|||
heap1_execute
|
||||
};
|
||||
|
||||
#endif /* CH_USE_HEAP.*/
|
||||
#endif /* CH_CFG_USE_HEAP.*/
|
||||
|
||||
/**
|
||||
* @brief Test sequence for heap.
|
||||
*/
|
||||
ROMCONST struct testcase * ROMCONST patternheap[] = {
|
||||
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
|
||||
#if (CH_CFG_USE_HEAP && !CH_CFG_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
|
||||
&testheap1,
|
||||
#endif
|
||||
NULL
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* <h2>Preconditions</h2>
|
||||
* The module requires the following kernel options:
|
||||
* - @p CH_USE_MAILBOXES
|
||||
* - @p CH_CFG_USE_MAILBOXES
|
||||
* .
|
||||
* In case some of the required options are not enabled then some or all tests
|
||||
* may be skipped.
|
||||
|
@ -47,7 +47,7 @@
|
|||
* @brief Mailboxes header file
|
||||
*/
|
||||
|
||||
#if CH_USE_MAILBOXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MAILBOXES || defined(__DOXYGEN__)
|
||||
|
||||
#define ALLOWED_DELAY MS2ST(5)
|
||||
#define MB_SIZE 5
|
||||
|
@ -226,13 +226,13 @@ ROMCONST struct testcase testmbox1 = {
|
|||
mbox1_execute
|
||||
};
|
||||
|
||||
#endif /* CH_USE_MAILBOXES */
|
||||
#endif /* CH_CFG_USE_MAILBOXES */
|
||||
|
||||
/**
|
||||
* @brief Test sequence for mailboxes.
|
||||
*/
|
||||
ROMCONST struct testcase * ROMCONST patternmbox[] = {
|
||||
#if CH_USE_MAILBOXES || defined(__DOXYGEN__)
|
||||
#if CH_CFG_USE_MAILBOXES || defined(__DOXYGEN__)
|
||||
&testmbox1,
|
||||
#endif
|
||||
NULL
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue