aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-07-20 10:12:44 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-07-20 10:12:44 +0000
commit49d71a01abeefa000a4cd7a556052d826b096d49 (patch)
tree8c5ce964f194d9f7b17e91d912d9e6d723e4b8ae
parentdc7b36df31f4d9dbd9a039319df74f4b2c8eed0c (diff)
downloadChibiOS-49d71a01abeefa000a4cd7a556052d826b096d49.tar.gz
ChibiOS-49d71a01abeefa000a4cd7a556052d826b096d49.tar.bz2
ChibiOS-49d71a01abeefa000a4cd7a556052d826b096d49.zip
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-d51de3d6d3f4
-rw-r--r--demos/ARMCM4-STM32F303-DISCOVERY/chconf.h185
-rw-r--r--os/hal/include/adc.h4
-rw-r--r--os/hal/include/can.h4
-rw-r--r--os/hal/include/i2c.h4
-rw-r--r--os/hal/include/io_channel.h4
-rw-r--r--os/hal/include/mac.h8
-rw-r--r--os/hal/include/mmc_spi.h4
-rw-r--r--os/hal/include/serial.h4
-rw-r--r--os/hal/include/serial_usb.h6
-rw-r--r--os/hal/include/spi.h4
-rw-r--r--os/hal/platforms/AT91SAM7/adc_lld.h4
-rw-r--r--os/hal/platforms/AT91SAM7/i2c_lld.h4
-rw-r--r--os/hal/platforms/AT91SAM7/spi_lld.h4
-rw-r--r--os/hal/platforms/AVR/i2c_lld.h4
-rw-r--r--os/hal/platforms/LPC11Uxx/hal_lld.c2
-rw-r--r--os/hal/platforms/LPC11Uxx/spi_lld.h4
-rw-r--r--os/hal/platforms/LPC11xx/hal_lld.c2
-rw-r--r--os/hal/platforms/LPC11xx/i2c_lld.h4
-rw-r--r--os/hal/platforms/LPC11xx/spi_lld.h4
-rw-r--r--os/hal/platforms/LPC122x/hal_lld.c2
-rw-r--r--os/hal/platforms/LPC122x/i2c_lld.h4
-rw-r--r--os/hal/platforms/LPC122x/spi_lld.h4
-rw-r--r--os/hal/platforms/LPC13xx/hal_lld.c2
-rw-r--r--os/hal/platforms/LPC13xx/spi_lld.h4
-rw-r--r--os/hal/platforms/LPC214x/spi_lld.h4
-rw-r--r--os/hal/platforms/LPC8xx/hal_lld.c2
-rw-r--r--os/hal/platforms/LPC8xx/spi_lld.h4
-rw-r--r--os/hal/platforms/Posix/hal_lld.c2
-rw-r--r--os/hal/platforms/SPC560BCxx/hal_lld.c2
-rw-r--r--os/hal/platforms/SPC560Dxx/hal_lld.c2
-rw-r--r--os/hal/platforms/SPC560Pxx/hal_lld.c2
-rw-r--r--os/hal/platforms/SPC563Mxx/hal_lld.c2
-rw-r--r--os/hal/platforms/SPC564Axx/hal_lld.c2
-rw-r--r--os/hal/platforms/SPC56ELxx/hal_lld.c2
-rw-r--r--os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.h4
-rw-r--r--os/hal/platforms/SPC5xx/EQADC_v1/adc_lld.h4
-rw-r--r--os/hal/platforms/STM32/I2Cv1/i2c_lld.h4
-rw-r--r--os/hal/platforms/STM32/I2Cv2/i2c_lld.h4
-rw-r--r--os/hal/platforms/STM32/SPIv1/spi_lld.h4
-rw-r--r--os/hal/platforms/STM32/SPIv2/spi_lld.h4
-rw-r--r--os/hal/platforms/STM32F0xx/adc_lld.h4
-rw-r--r--os/hal/platforms/STM32F0xx/hal_lld.c2
-rw-r--r--os/hal/platforms/STM32F1xx/adc_lld.h4
-rw-r--r--os/hal/platforms/STM32F1xx/hal_lld.c2
-rw-r--r--os/hal/platforms/STM32F30x/adc_lld.h4
-rw-r--r--os/hal/platforms/STM32F30x/hal_lld.c2
-rw-r--r--os/hal/platforms/STM32F37x/adc_lld.h4
-rw-r--r--os/hal/platforms/STM32F37x/hal_lld.c2
-rw-r--r--os/hal/platforms/STM32F4xx/adc_lld.h4
-rw-r--r--os/hal/platforms/STM32F4xx/hal_lld.c2
-rw-r--r--os/hal/platforms/STM32L1xx/adc_lld.h4
-rw-r--r--os/hal/platforms/STM32L1xx/hal_lld.c2
-rw-r--r--os/hal/platforms/STM8S/spi_lld.h4
-rw-r--r--os/hal/platforms/Win32/hal_lld.c2
-rw-r--r--os/hal/src/adc.c10
-rw-r--r--os/hal/src/i2c.c12
-rw-r--r--os/hal/src/spi.c10
-rw-r--r--os/kernel/include/chbsem.h6
-rw-r--r--os/kernel/include/chcond.h10
-rw-r--r--os/kernel/include/chdynamic.h16
-rw-r--r--os/kernel/include/chevents.h10
-rw-r--r--os/kernel/include/chheap.h14
-rw-r--r--os/kernel/include/chlists.h4
-rw-r--r--os/kernel/include/chmboxes.h8
-rw-r--r--os/kernel/include/chmemcore.h4
-rw-r--r--os/kernel/include/chmempools.h8
-rw-r--r--os/kernel/include/chmsg.h4
-rw-r--r--os/kernel/include/chmtx.h4
-rw-r--r--os/kernel/include/chqueues.h5
-rw-r--r--os/kernel/include/chregistry.h12
-rw-r--r--os/kernel/include/chschd.h8
-rw-r--r--os/kernel/include/chsem.h6
-rw-r--r--os/kernel/include/chsys.h2
-rw-r--r--os/kernel/include/chthreads.h28
-rw-r--r--os/kernel/include/chvt.h6
-rw-r--r--os/kernel/src/chcond.c14
-rw-r--r--os/kernel/src/chdynamic.c28
-rw-r--r--os/kernel/src/chevents.c14
-rw-r--r--os/kernel/src/chheap.c12
-rw-r--r--os/kernel/src/chlists.c4
-rw-r--r--os/kernel/src/chmboxes.c6
-rw-r--r--os/kernel/src/chmemcore.c12
-rw-r--r--os/kernel/src/chmempools.c6
-rw-r--r--os/kernel/src/chmsg.c10
-rw-r--r--os/kernel/src/chmtx.c18
-rw-r--r--os/kernel/src/chqueues.c6
-rw-r--r--os/kernel/src/chregistry.c16
-rw-r--r--os/kernel/src/chschd.c30
-rw-r--r--os/kernel/src/chsem.c14
-rw-r--r--os/kernel/src/chsys.c28
-rw-r--r--os/kernel/src/chthreads.c44
-rw-r--r--os/kernel/templates/chconf.h185
-rw-r--r--os/kernel/templates/chtypes.h38
-rw-r--r--os/kernel/templates/module.c4
-rw-r--r--os/kernel/templates/module.h4
-rw-r--r--test/testbmk.c16
-rw-r--r--test/testdyn.c34
-rw-r--r--test/testevt.c16
-rw-r--r--test/testheap.c8
-rw-r--r--test/testmbox.c8
-rw-r--r--test/testmsg.c8
-rw-r--r--test/testmtx.c20
-rw-r--r--test/testpools.c8
-rw-r--r--test/testqueues.c8
-rw-r--r--test/testsem.c18
-rw-r--r--test/testthd.c4
106 files changed, 578 insertions, 615 deletions
diff --git a/demos/ARMCM4-STM32F303-DISCOVERY/chconf.h b/demos/ARMCM4-STM32F303-DISCOVERY/chconf.h
index 0e93aa661..20065b614 100644
--- a/demos/ARMCM4-STM32F303-DISCOVERY/chconf.h
+++ b/demos/ARMCM4-STM32F303-DISCOVERY/chconf.h
@@ -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.
- */
-#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.
+ * @note The default is @p FALSE. Enable this if you have special
+ * requirements.
+ * @note Requires @p CH_CFG_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
diff --git a/os/hal/include/adc.h b/os/hal/include/adc.h
index c41435452..bff1bb996 100644
--- a/os/hal/include/adc.h
+++ b/os/hal/include/adc.h
@@ -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
/*===========================================================================*/
diff --git a/os/hal/include/can.h b/os/hal/include/can.h
index 6cd2f55c1..7b649827f 100644
--- a/os/hal/include/can.h
+++ b/os/hal/include/can.h
@@ -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
/*===========================================================================*/
diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h
index 2e45450ee..7be2e4ef1 100644
--- a/os/hal/include/i2c.h
+++ b/os/hal/include/i2c.h
@@ -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
/*===========================================================================*/
diff --git a/os/hal/include/io_channel.h b/os/hal/include/io_channel.h
index b0c21a9ee..f48eae822 100644
--- a/os/hal/include/io_channel.h
+++ b/os/hal/include/io_channel.h
@@ -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_ */
diff --git a/os/hal/include/mac.h b/os/hal/include/mac.h
index 868460ad5..8b882054a 100644
--- a/os/hal/include/mac.h
+++ b/os/hal/include/mac.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
/*===========================================================================*/
diff --git a/os/hal/include/mmc_spi.h b/os/hal/include/mmc_spi.h
index 5732570b6..3d7eacb21 100644
--- a/os/hal/include/mmc_spi.h
+++ b/os/hal/include/mmc_spi.h
@@ -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
/*===========================================================================*/
diff --git a/os/hal/include/serial.h b/os/hal/include/serial.h
index a44e10cac..ac3ea3130 100644
--- a/os/hal/include/serial.h
+++ b/os/hal/include/serial.h
@@ -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
/*===========================================================================*/
diff --git a/os/hal/include/serial_usb.h b/os/hal/include/serial_usb.h
index 28ab3a940..83aa4ec69 100644
--- a/os/hal/include/serial_usb.h
+++ b/os/hal/include/serial_usb.h
@@ -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
/*===========================================================================*/
diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h
index f9988631b..d7eb2a7e0 100644
--- a/os/hal/include/spi.h
+++ b/os/hal/include/spi.h
@@ -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
/*===========================================================================*/
diff --git a/os/hal/platforms/AT91SAM7/adc_lld.h b/os/hal/platforms/AT91SAM7/adc_lld.h
index e27931819..fcdd9ecf6 100644
--- a/os/hal/platforms/AT91SAM7/adc_lld.h
+++ b/os/hal/platforms/AT91SAM7/adc_lld.h
@@ -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 */
diff --git a/os/hal/platforms/AT91SAM7/i2c_lld.h b/os/hal/platforms/AT91SAM7/i2c_lld.h
index 8e22acaf6..be4e2f1be 100644
--- a/os/hal/platforms/AT91SAM7/i2c_lld.h
+++ b/os/hal/platforms/AT91SAM7/i2c_lld.h
@@ -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 */
diff --git a/os/hal/platforms/AT91SAM7/spi_lld.h b/os/hal/platforms/AT91SAM7/spi_lld.h
index 18299391a..fda7adbbf 100644
--- a/os/hal/platforms/AT91SAM7/spi_lld.h
+++ b/os/hal/platforms/AT91SAM7/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/AVR/i2c_lld.h b/os/hal/platforms/AVR/i2c_lld.h
index 9e49cefbe..88a9eb4b9 100644
--- a/os/hal/platforms/AVR/i2c_lld.h
+++ b/os/hal/platforms/AVR/i2c_lld.h
@@ -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 */
diff --git a/os/hal/platforms/LPC11Uxx/hal_lld.c b/os/hal/platforms/LPC11Uxx/hal_lld.c
index 0e795c1a0..6a16de6f5 100644
--- a/os/hal/platforms/LPC11Uxx/hal_lld.c
+++ b/os/hal/platforms/LPC11Uxx/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/LPC11Uxx/spi_lld.h b/os/hal/platforms/LPC11Uxx/spi_lld.h
index 9d15dcee2..46d2e657c 100644
--- a/os/hal/platforms/LPC11Uxx/spi_lld.h
+++ b/os/hal/platforms/LPC11Uxx/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/LPC11xx/hal_lld.c b/os/hal/platforms/LPC11xx/hal_lld.c
index af14d406a..2c10e3404 100644
--- a/os/hal/platforms/LPC11xx/hal_lld.c
+++ b/os/hal/platforms/LPC11xx/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/LPC11xx/i2c_lld.h b/os/hal/platforms/LPC11xx/i2c_lld.h
index b908ba6e4..b33dfe235 100644
--- a/os/hal/platforms/LPC11xx/i2c_lld.h
+++ b/os/hal/platforms/LPC11xx/i2c_lld.h
@@ -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 */
diff --git a/os/hal/platforms/LPC11xx/spi_lld.h b/os/hal/platforms/LPC11xx/spi_lld.h
index 4d6c56027..677e18062 100644
--- a/os/hal/platforms/LPC11xx/spi_lld.h
+++ b/os/hal/platforms/LPC11xx/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/LPC122x/hal_lld.c b/os/hal/platforms/LPC122x/hal_lld.c
index 9069434ba..d457c7aea 100644
--- a/os/hal/platforms/LPC122x/hal_lld.c
+++ b/os/hal/platforms/LPC122x/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/LPC122x/i2c_lld.h b/os/hal/platforms/LPC122x/i2c_lld.h
index edff13a95..1603da79c 100644
--- a/os/hal/platforms/LPC122x/i2c_lld.h
+++ b/os/hal/platforms/LPC122x/i2c_lld.h
@@ -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 */
diff --git a/os/hal/platforms/LPC122x/spi_lld.h b/os/hal/platforms/LPC122x/spi_lld.h
index 0cb48f89f..d53ed620a 100644
--- a/os/hal/platforms/LPC122x/spi_lld.h
+++ b/os/hal/platforms/LPC122x/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/LPC13xx/hal_lld.c b/os/hal/platforms/LPC13xx/hal_lld.c
index 561537537..553e5f445 100644
--- a/os/hal/platforms/LPC13xx/hal_lld.c
+++ b/os/hal/platforms/LPC13xx/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/LPC13xx/spi_lld.h b/os/hal/platforms/LPC13xx/spi_lld.h
index 9328cd69d..ac5621b04 100644
--- a/os/hal/platforms/LPC13xx/spi_lld.h
+++ b/os/hal/platforms/LPC13xx/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/LPC214x/spi_lld.h b/os/hal/platforms/LPC214x/spi_lld.h
index 9def6f16a..528e7ca88 100644
--- a/os/hal/platforms/LPC214x/spi_lld.h
+++ b/os/hal/platforms/LPC214x/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/LPC8xx/hal_lld.c b/os/hal/platforms/LPC8xx/hal_lld.c
index e5170fcc4..026205706 100644
--- a/os/hal/platforms/LPC8xx/hal_lld.c
+++ b/os/hal/platforms/LPC8xx/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/LPC8xx/spi_lld.h b/os/hal/platforms/LPC8xx/spi_lld.h
index 4acd52547..f4e6192fc 100644
--- a/os/hal/platforms/LPC8xx/spi_lld.h
+++ b/os/hal/platforms/LPC8xx/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/Posix/hal_lld.c b/os/hal/platforms/Posix/hal_lld.c
index fb1bed779..ae9a6574c 100644
--- a/os/hal/platforms/Posix/hal_lld.c
+++ b/os/hal/platforms/Posix/hal_lld.c
@@ -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. */
diff --git a/os/hal/platforms/SPC560BCxx/hal_lld.c b/os/hal/platforms/SPC560BCxx/hal_lld.c
index 5d14daf27..e0d22bfa5 100644
--- a/os/hal/platforms/SPC560BCxx/hal_lld.c
+++ b/os/hal/platforms/SPC560BCxx/hal_lld.c
@@ -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;
diff --git a/os/hal/platforms/SPC560Dxx/hal_lld.c b/os/hal/platforms/SPC560Dxx/hal_lld.c
index 229051979..4ecdc2b4a 100644
--- a/os/hal/platforms/SPC560Dxx/hal_lld.c
+++ b/os/hal/platforms/SPC560Dxx/hal_lld.c
@@ -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;
diff --git a/os/hal/platforms/SPC560Pxx/hal_lld.c b/os/hal/platforms/SPC560Pxx/hal_lld.c
index 799908d46..38519095b 100644
--- a/os/hal/platforms/SPC560Pxx/hal_lld.c
+++ b/os/hal/platforms/SPC560Pxx/hal_lld.c
@@ -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;
diff --git a/os/hal/platforms/SPC563Mxx/hal_lld.c b/os/hal/platforms/SPC563Mxx/hal_lld.c
index 22979e61b..105193b87 100644
--- a/os/hal/platforms/SPC563Mxx/hal_lld.c
+++ b/os/hal/platforms/SPC563Mxx/hal_lld.c
@@ -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. */
diff --git a/os/hal/platforms/SPC564Axx/hal_lld.c b/os/hal/platforms/SPC564Axx/hal_lld.c
index f6b220c85..55d8331db 100644
--- a/os/hal/platforms/SPC564Axx/hal_lld.c
+++ b/os/hal/platforms/SPC564Axx/hal_lld.c
@@ -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. */
diff --git a/os/hal/platforms/SPC56ELxx/hal_lld.c b/os/hal/platforms/SPC56ELxx/hal_lld.c
index 4a3976f50..6fec560bd 100644
--- a/os/hal/platforms/SPC56ELxx/hal_lld.c
+++ b/os/hal/platforms/SPC56ELxx/hal_lld.c
@@ -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. */
diff --git a/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.h b/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.h
index b79e13a8e..1e2e9fd1c 100644
--- a/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.h
+++ b/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/SPC5xx/EQADC_v1/adc_lld.h b/os/hal/platforms/SPC5xx/EQADC_v1/adc_lld.h
index 6be4ca5d4..f8713c9e8 100644
--- a/os/hal/platforms/SPC5xx/EQADC_v1/adc_lld.h
+++ b/os/hal/platforms/SPC5xx/EQADC_v1/adc_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32/I2Cv1/i2c_lld.h b/os/hal/platforms/STM32/I2Cv1/i2c_lld.h
index dcadb3278..1701a6e24 100644
--- a/os/hal/platforms/STM32/I2Cv1/i2c_lld.h
+++ b/os/hal/platforms/STM32/I2Cv1/i2c_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32/I2Cv2/i2c_lld.h b/os/hal/platforms/STM32/I2Cv2/i2c_lld.h
index 810c7be84..a26665278 100644
--- a/os/hal/platforms/STM32/I2Cv2/i2c_lld.h
+++ b/os/hal/platforms/STM32/I2Cv2/i2c_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32/SPIv1/spi_lld.h b/os/hal/platforms/STM32/SPIv1/spi_lld.h
index fe37c8f66..bc940f2cd 100644
--- a/os/hal/platforms/STM32/SPIv1/spi_lld.h
+++ b/os/hal/platforms/STM32/SPIv1/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32/SPIv2/spi_lld.h b/os/hal/platforms/STM32/SPIv2/spi_lld.h
index f4cc67da5..cc1676f00 100644
--- a/os/hal/platforms/STM32/SPIv2/spi_lld.h
+++ b/os/hal/platforms/STM32/SPIv2/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32F0xx/adc_lld.h b/os/hal/platforms/STM32F0xx/adc_lld.h
index 411e31581..0f432f3c7 100644
--- a/os/hal/platforms/STM32F0xx/adc_lld.h
+++ b/os/hal/platforms/STM32F0xx/adc_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32F0xx/hal_lld.c b/os/hal/platforms/STM32F0xx/hal_lld.c
index debc51ea3..b67156f10 100644
--- a/os/hal/platforms/STM32F0xx/hal_lld.c
+++ b/os/hal/platforms/STM32F0xx/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/STM32F1xx/adc_lld.h b/os/hal/platforms/STM32F1xx/adc_lld.h
index a4966d99d..9903f7dda 100644
--- a/os/hal/platforms/STM32F1xx/adc_lld.h
+++ b/os/hal/platforms/STM32F1xx/adc_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32F1xx/hal_lld.c b/os/hal/platforms/STM32F1xx/hal_lld.c
index eb87a1a84..1fee67cd3 100644
--- a/os/hal/platforms/STM32F1xx/hal_lld.c
+++ b/os/hal/platforms/STM32F1xx/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/STM32F30x/adc_lld.h b/os/hal/platforms/STM32F30x/adc_lld.h
index 85dd429f1..c4e0cb272 100644
--- a/os/hal/platforms/STM32F30x/adc_lld.h
+++ b/os/hal/platforms/STM32F30x/adc_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32F30x/hal_lld.c b/os/hal/platforms/STM32F30x/hal_lld.c
index 5c1d1efb1..64b691ade 100644
--- a/os/hal/platforms/STM32F30x/hal_lld.c
+++ b/os/hal/platforms/STM32F30x/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/STM32F37x/adc_lld.h b/os/hal/platforms/STM32F37x/adc_lld.h
index 2258952b1..302c65462 100644
--- a/os/hal/platforms/STM32F37x/adc_lld.h
+++ b/os/hal/platforms/STM32F37x/adc_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32F37x/hal_lld.c b/os/hal/platforms/STM32F37x/hal_lld.c
index a47ab59fc..c40c9e0e1 100644
--- a/os/hal/platforms/STM32F37x/hal_lld.c
+++ b/os/hal/platforms/STM32F37x/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/STM32F4xx/adc_lld.h b/os/hal/platforms/STM32F4xx/adc_lld.h
index 7cda791ac..cc173b42d 100644
--- a/os/hal/platforms/STM32F4xx/adc_lld.h
+++ b/os/hal/platforms/STM32F4xx/adc_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32F4xx/hal_lld.c b/os/hal/platforms/STM32F4xx/hal_lld.c
index f72812da9..cfffbb3da 100644
--- a/os/hal/platforms/STM32F4xx/hal_lld.c
+++ b/os/hal/platforms/STM32F4xx/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/STM32L1xx/adc_lld.h b/os/hal/platforms/STM32L1xx/adc_lld.h
index 2ac857c16..0f7864c37 100644
--- a/os/hal/platforms/STM32L1xx/adc_lld.h
+++ b/os/hal/platforms/STM32L1xx/adc_lld.h
@@ -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 */
diff --git a/os/hal/platforms/STM32L1xx/hal_lld.c b/os/hal/platforms/STM32L1xx/hal_lld.c
index 529099e6a..c1c61bbcd 100644
--- a/os/hal/platforms/STM32L1xx/hal_lld.c
+++ b/os/hal/platforms/STM32L1xx/hal_lld.c
@@ -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 |
diff --git a/os/hal/platforms/STM8S/spi_lld.h b/os/hal/platforms/STM8S/spi_lld.h
index 8b87b81fc..443be68e4 100644
--- a/os/hal/platforms/STM8S/spi_lld.h
+++ b/os/hal/platforms/STM8S/spi_lld.h
@@ -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 */
diff --git a/os/hal/platforms/Win32/hal_lld.c b/os/hal/platforms/Win32/hal_lld.c
index c86e84de7..c494bc96c 100644
--- a/os/hal/platforms/Win32/hal_lld.c
+++ b/os/hal/platforms/Win32/hal_lld.c
@@ -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;
diff --git a/os/hal/src/adc.c b/os/hal/src/adc.c
index d0e814ae2..aeb1f6c6b 100644
--- a/os/hal/src/adc.c
+++ b/os/hal/src/adc.c
@@ -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
}
diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c
index 78519cc35..8604488e5 100644
--- a/os/hal/src/i2c.c
+++ b/os/hal/src/i2c.c
@@ -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
}
diff --git a/os/hal/src/spi.c b/os/hal/src/spi.c
index 2dc0cc6ee..b2ddf48d2 100644
--- a/os/hal/src/spi.c
+++ b/os/hal/src/spi.c
@@ -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
}
diff --git a/os/kernel/include/chbsem.h b/os/kernel/include/chbsem.h
index 2808f9c41..6a5397e8e 100644
--- a/os/kernel/include/chbsem.h
+++ b/os/kernel/include/chbsem.h
@@ -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_ */
diff --git a/os/kernel/include/chcond.h b/os/kernel/include/chcond.h
index 5b26a2281..802d59d3a 100644
--- a/os/kernel/include/chcond.h
+++ b/os/kernel/include/chcond.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_ */
diff --git a/os/kernel/include/chdynamic.h b/os/kernel/include/chdynamic.h
index 752fee90c..cb72bb244 100644
--- a/os/kernel/include/chdynamic.h
+++ b/os/kernel/include/chdynamic.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_ */
diff --git a/os/kernel/include/chevents.h b/os/kernel/include/chevents.h
index 327b16c88..e15d0e6cb 100644
--- a/os/kernel/include/chevents.h
+++ b/os/kernel/include/chevents.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_ */
diff --git a/os/kernel/include/chheap.h b/os/kernel/include/chheap.h
index bc5a9afb4..73e0d4148 100644
--- a/os/kernel/include/chheap.h
+++ b/os/kernel/include/chheap.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_ */
diff --git a/os/kernel/include/chlists.h b/os/kernel/include/chlists.h
index 3f71b2afc..69a42bcce 100644
--- a/os/kernel/include/chlists.h
+++ b/os/kernel/include/chlists.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_ */
diff --git a/os/kernel/include/chmboxes.h b/os/kernel/include/chmboxes.h
index f34f32c87..8d1dedfd1 100644
--- a/os/kernel/include/chmboxes.h
+++ b/os/kernel/include/chmboxes.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_ */
diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h
index dbc5d5d60..314e94365 100644
--- a/os/kernel/include/chmemcore.h
+++ b/os/kernel/include/chmemcore.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_ */
diff --git a/os/kernel/include/chmempools.h b/os/kernel/include/chmempools.h
index f09db04ea..85b94fc73 100644
--- a/os/kernel/include/chmempools.h
+++ b/os/kernel/include/chmempools.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_ */
diff --git a/os/kernel/include/chmsg.h b/os/kernel/include/chmsg.h
index 4461b30dd..ff07edfb3 100644
--- a/os/kernel/include/chmsg.h
+++ b/os/kernel/include/chmsg.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_ */
diff --git a/os/kernel/include/chmtx.h b/os/kernel/include/chmtx.h
index d6f2ddf3d..a4ff5e49f 100644
--- a/os/kernel/include/chmtx.h
+++ b/os/kernel/include/chmtx.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_ */
diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h
index acb2f8919..8449442c3 100644
--- a/os/kernel/include/chqueues.h
+++ b/os/kernel/include/chqueues.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_ */
diff --git a/os/kernel/include/chregistry.h b/os/kernel/include/chregistry.h
index b176058ce..a8318bc53 100644
--- a/os/kernel/include/chregistry.h
+++ b/os/kernel/include/chregistry.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_ */
diff --git a/os/kernel/include/chschd.h b/os/kernel/include/chschd.h
index 3aa189dcd..0d12acdf0 100644
--- a/os/kernel/include/chschd.h
+++ b/os/kernel/include/chschd.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_ */
diff --git a/os/kernel/include/chsem.h b/os/kernel/include/chsem.h
index d8cbdc944..21ee14293 100644
--- a/os/kernel/include/chsem.h
+++ b/os/kernel/include/chsem.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_ */
diff --git a/os/kernel/include/chsys.h b/os/kernel/include/chsys.h
index 5585117b6..e87d0c6c1 100644
--- a/os/kernel/include/chsys.h
+++ b/os/kernel/include/chsys.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);
}
diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h
index ef5a0dbe9..f4785a268 100644
--- a/os/kernel/include/chthreads.h
+++ b/os/kernel/include/chthreads.h
@@ -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
diff --git a/os/kernel/include/chvt.h b/os/kernel/include/chvt.h
index 6e30d903c..e88d03d15 100644
--- a/os/kernel/include/chvt.h
+++ b/os/kernel/include/chvt.h
@@ -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))
/** @} */
diff --git a/os/kernel/src/chcond.c b/os/kernel/src/chcond.c
index d4d845512..8486705e6 100644
--- a/os/kernel/src/chcond.c
+++ b/os/kernel/src/chcond.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chdynamic.c b/os/kernel/src/chdynamic.c
index 21c81fc24..cab5556f3 100644
--- a/os/kernel/src/chdynamic.c
+++ b/os/kernel/src/chdynamic.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chevents.c b/os/kernel/src/chevents.c
index 1206b61fe..f48a3ec9a 100644
--- a/os/kernel/src/chevents.c
+++ b/os/kernel/src/chevents.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chheap.c b/os/kernel/src/chheap.c
index b41817123..c2732376e 100644
--- a/os/kernel/src/chheap.c
+++ b/os/kernel/src/chheap.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chlists.c b/os/kernel/src/chlists.c
index 241067ab4..0f492db5f 100644
--- a/os/kernel/src/chlists.c
+++ b/os/kernel/src/chlists.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chmboxes.c b/os/kernel/src/chmboxes.c
index b1a4fb963..2a6e6fae8 100644
--- a/os/kernel/src/chmboxes.c
+++ b/os/kernel/src/chmboxes.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chmemcore.c b/os/kernel/src/chmemcore.c
index 76f415743..d5e7ed79c 100644
--- a/os/kernel/src/chmemcore.c
+++ b/os/kernel/src/chmemcore.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chmempools.c b/os/kernel/src/chmempools.c
index 44557235b..6d84b557e 100644
--- a/os/kernel/src/chmempools.c
+++ b/os/kernel/src/chmempools.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chmsg.c b/os/kernel/src/chmsg.c
index b53f91979..535143b7c 100644
--- a/os/kernel/src/chmsg.c
+++ b/os/kernel/src/chmsg.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chmtx.c b/os/kernel/src/chmtx.c
index ec191b53d..be9c6dd78 100644
--- a/os/kernel/src/chmtx.c
+++ b/os/kernel/src/chmtx.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chqueues.c b/os/kernel/src/chqueues.c
index 7115d77b6..fcaa2895f 100644
--- a/os/kernel/src/chqueues.c
+++ b/os/kernel/src/chqueues.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chregistry.c b/os/kernel/src/chregistry.c
index 832ef0ce9..b43341edd 100644
--- a/os/kernel/src/chregistry.c
+++ b/os/kernel/src/chregistry.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c
index 4592f4806..c360777ef 100644
--- a/os/kernel/src/chschd.c
+++ b/os/kernel/src/chschd.c
@@ -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) */
}
/** @} */
diff --git a/os/kernel/src/chsem.c b/os/kernel/src/chsem.c
index 554c02246..bcf222230 100644
--- a/os/kernel/src/chsem.c
+++ b/os/kernel/src/chsem.c
@@ -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 */
/** @} */
diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c
index b3d99a7d9..97f01f933 100644
--- a/os/kernel/src/chsys.c
+++ b/os/kernel/src/chsys.c
@@ -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
}
diff --git a/os/kernel/src/chthreads.c b/os/kernel/src/chthreads.c
index 47f53e10d..17eeb763b 100644
--- a/os/kernel/src/chthreads.c
+++ b/os/kernel/src/chthreads.c
@@ -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 */
/** @} */
diff --git a/os/kernel/templates/chconf.h b/os/kernel/templates/chconf.h
index 652a6adee..eebd5f122 100644
--- a/os/kernel/templates/chconf.h
+++ b/os/kernel/templates/chconf.h
@@ -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_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_TIME_QUANTUM) || defined(__DOXYGEN__)
-#define CH_TIME_QUANTUM 20
+#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.
- */
-#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.
+ * @note The default is @p FALSE. Enable this if you have special
+ * requirements.
+ * @note Requires @p CH_CFG_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
diff --git a/os/kernel/templates/chtypes.h b/os/kernel/templates/chtypes.h
index 5bf0ff0f0..d13e837c4 100644
--- a/os/kernel/templates/chtypes.h
+++ b/os/kernel/templates/chtypes.h
@@ -43,11 +43,6 @@
#endif
/**
- * @brief Boolean, recommended the fastest signed.
- */
-typedef int32_t bool_t;
-
-/**
* @brief Thread mode flags, uint8_t is ok.
*/
typedef uint8_t tmode_t;
@@ -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_ */
/** @} */
diff --git a/os/kernel/templates/module.c b/os/kernel/templates/module.c
index a079437a2..6a93bf4aa 100644
--- a/os/kernel/templates/module.c
+++ b/os/kernel/templates/module.c
@@ -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 */
/** @} */
diff --git a/os/kernel/templates/module.h b/os/kernel/templates/module.h
index a76b8177e..261311f84 100644
--- a/os/kernel/templates/module.h
+++ b/os/kernel/templates/module.h
@@ -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_ */
diff --git a/test/testbmk.c b/test/testbmk.c
index 5e423f34d..ce8b8d51e 100644
--- a/test/testbmk.c
+++ b/test/testbmk.c
@@ -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,
diff --git a/test/testdyn.c b/test/testdyn.c
index 3f157686d..31fd0c005 100644
--- a/test/testdyn.c
+++ b/test/testdyn.c
@@ -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
diff --git a/test/testevt.c b/test/testevt.c
index 80bc18ae7..bb9381139 100644
--- a/test/testevt.c
+++ b/test/testevt.c
@@ -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 */
diff --git a/test/testheap.c b/test/testheap.c
index 667b64cb2..d257a4362 100644
--- a/test/testheap.c
+++ b/test/testheap.c
@@ -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
diff --git a/test/testmbox.c b/test/testmbox.c
index c9d554e16..0ba52aa09 100644
--- a/test/testmbox.c
+++ b/test/testmbox.c
@@ -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
diff --git a/test/testmsg.c b/test/testmsg.c
index 7a1ef1175..30d7f24dd 100644
--- a/test/testmsg.c
+++ b/test/testmsg.c
@@ -31,7 +31,7 @@
*
* <h2>Preconditions</h2>
* The module requires the following kernel options:
- * - @p CH_USE_MESSAGES
+ * - @p CH_CFG_USE_MESSAGES
* .
* In case some of the required options are not enabled then some or all tests
* may be skipped.
@@ -45,7 +45,7 @@
* @brief Messages header file
*/
-#if CH_USE_MESSAGES || defined(__DOXYGEN__)
+#if CH_CFG_USE_MESSAGES || defined(__DOXYGEN__)
/**
* @page test_msg_001 Messages Server loop
@@ -95,13 +95,13 @@ ROMCONST struct testcase testmsg1 = {
msg1_execute
};
-#endif /* CH_USE_MESSAGES */
+#endif /* CH_CFG_USE_MESSAGES */
/**
* @brief Test sequence for messages.
*/
ROMCONST struct testcase * ROMCONST patternmsg[] = {
-#if CH_USE_MESSAGES || defined(__DOXYGEN__)
+#if CH_CFG_USE_MESSAGES || defined(__DOXYGEN__)
&testmsg1,
#endif
NULL
diff --git a/test/testmtx.c b/test/testmtx.c
index caaf91409..c775cb51b 100644
--- a/test/testmtx.c
+++ b/test/testmtx.c
@@ -33,8 +33,8 @@
*
* <h2>Preconditions</h2>
* The module requires the following kernel options:
- * - @p CH_USE_MUTEXES
- * - @p CH_USE_CONDVARS
+ * - @p CH_CFG_USE_MUTEXES
+ * - @p CH_CFG_USE_CONDVARS
* - @p CH_DBG_THREADS_PROFILING
* .
* In case some of the required options are not enabled then some or all tests
@@ -56,7 +56,7 @@
* @brief Mutexes and CondVars test header file
*/
-#if CH_USE_MUTEXES || defined(__DOXYGEN__)
+#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
#define ALLOWED_DELAY 5
@@ -67,7 +67,7 @@
*/
static MUTEX_DECL(m1);
static MUTEX_DECL(m2);
-#if CH_USE_CONDVARS || defined(__DOXYGEN__)
+#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
static CONDVAR_DECL(c1);
#endif
@@ -463,7 +463,7 @@ ROMCONST struct testcase testmtx5 = {
mtx5_execute
};
-#if CH_USE_CONDVARS || defined(__DOXYGEN__)
+#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
/**
* @page test_mtx_006 Condition Variable signal test
*
@@ -573,7 +573,7 @@ static msg_t thread11(void *p) {
chMtxLock(&m2);
chMtxLock(&m1);
-#if CH_USE_CONDVARS_TIMEOUT || defined(__DOXYGEN__)
+#if CH_CFG_USE_CONDVARS_TIMEOUT || defined(__DOXYGEN__)
chCondWaitTimeout(&c1, TIME_INFINITE);
#else
chCondWait(&c1);
@@ -610,14 +610,14 @@ ROMCONST struct testcase testmtx8 = {
NULL,
mtx8_execute
};
-#endif /* CH_USE_CONDVARS */
-#endif /* CH_USE_MUTEXES */
+#endif /* CH_CFG_USE_CONDVARS */
+#endif /* CH_CFG_USE_MUTEXES */
/**
* @brief Test sequence for mutexes.
*/
ROMCONST struct testcase * ROMCONST patternmtx[] = {
-#if CH_USE_MUTEXES || defined(__DOXYGEN__)
+#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
&testmtx1,
#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
&testmtx2,
@@ -625,7 +625,7 @@ ROMCONST struct testcase * ROMCONST patternmtx[] = {
#endif
&testmtx4,
&testmtx5,
-#if CH_USE_CONDVARS || defined(__DOXYGEN__)
+#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
&testmtx6,
&testmtx7,
&testmtx8,
diff --git a/test/testpools.c b/test/testpools.c
index 6ff669227..18063e111 100644
--- a/test/testpools.c
+++ b/test/testpools.c
@@ -30,7 +30,7 @@
*
* <h2>Preconditions</h2>
* The module requires the following kernel options:
- * - @p CH_USE_MEMPOOLS
+ * - @p CH_CFG_USE_MEMPOOLS
* .
* In case some of the required options are not enabled then some or all tests
* may be skipped.
@@ -44,7 +44,7 @@
* @brief Memory Pools test header file
*/
-#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
+#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
static MEMORYPOOL_DECL(mp1, THD_WA_SIZE(THREADS_STACK_SIZE), NULL);
@@ -104,13 +104,13 @@ ROMCONST struct testcase testpools1 = {
pools1_execute
};
-#endif /* CH_USE_MEMPOOLS */
+#endif /* CH_CFG_USE_MEMPOOLS */
/*
* @brief Test sequence for pools.
*/
ROMCONST struct testcase * ROMCONST patternpools[] = {
-#if CH_USE_MEMPOOLS || defined(__DOXYGEN__)
+#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
&testpools1,
#endif
NULL
diff --git a/test/testqueues.c b/test/testqueues.c
index 7f682ef8e..d19ca5e00 100644
--- a/test/testqueues.c
+++ b/test/testqueues.c
@@ -35,7 +35,7 @@
*
* <h2>Preconditions</h2>
* The module requires the following kernel options:
- * - @p CH_USE_QUEUES (and dependent options)
+ * - @p CH_CFG_USE_QUEUES (and dependent options)
* .
* In case some of the required options are not enabled then some or all tests
* may be skipped.
@@ -50,7 +50,7 @@
* @brief I/O Queues test header file
*/
-#if CH_USE_QUEUES || defined(__DOXYGEN__)
+#if CH_CFG_USE_QUEUES || defined(__DOXYGEN__)
#define TEST_QUEUES_SIZE 4
@@ -230,13 +230,13 @@ ROMCONST struct testcase testqueues2 = {
NULL,
queues2_execute
};
-#endif /* CH_USE_QUEUES */
+#endif /* CH_CFG_USE_QUEUES */
/**
* @brief Test sequence for queues.
*/
ROMCONST struct testcase * ROMCONST patternqueues[] = {
-#if CH_USE_QUEUES || defined(__DOXYGEN__)
+#if CH_CFG_USE_QUEUES || defined(__DOXYGEN__)
&testqueues1,
&testqueues2,
#endif
diff --git a/test/testsem.c b/test/testsem.c
index b27540059..9483a75d6 100644
--- a/test/testsem.c
+++ b/test/testsem.c
@@ -30,7 +30,7 @@
*
* <h2>Preconditions</h2>
* The module requires the following kernel options:
- * - @p CH_USE_SEMAPHORES
+ * - @p CH_CFG_USE_SEMAPHORES
* .
* In case some of the required options are not enabled then some or all tests
* may be skipped.
@@ -47,7 +47,7 @@
* @brief Semaphores test header file
*/
-#if CH_USE_SEMAPHORES || defined(__DOXYGEN__)
+#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
#define ALLOWED_DELAY MS2ST(5)
@@ -65,7 +65,7 @@ static SEMAPHORE_DECL(sem1, 0);
* Five threads with randomized priorities are enqueued to a semaphore then
* awakened one at time.<br>
* The test expects that the threads reach their goal in FIFO order or
- * priority order depending on the CH_USE_SEMAPHORES_PRIORITY configuration
+ * priority order depending on the CH_CFG_USE_SEMAPHORES_PRIORITY configuration
* setting.
*/
@@ -94,7 +94,7 @@ static void sem1_execute(void) {
chSemSignal(&sem1);
chSemSignal(&sem1);
test_wait_threads();
-#if CH_USE_SEMAPHORES_PRIORITY
+#if CH_CFG_USE_SEMAPHORES_PRIORITY
test_assert_sequence(1, "ADCEB");
#else
test_assert_sequence(1, "ABCDE");
@@ -188,7 +188,7 @@ ROMCONST struct testcase testsem2 = {
sem2_execute
};
-#if CH_USE_SEMSW || defined(__DOXYGEN__)
+#if CH_CFG_USE_SEMSW || defined(__DOXYGEN__)
/**
* @page test_sem_003 Atomic signal-wait test
*
@@ -232,7 +232,7 @@ ROMCONST struct testcase testsem3 = {
NULL,
sem3_execute
};
-#endif /* CH_USE_SEMSW */
+#endif /* CH_CFG_USE_SEMSW */
/**
* @page test_sem_004 Binary Wait and Signal
@@ -284,16 +284,16 @@ ROMCONST struct testcase testsem4 = {
NULL,
sem4_execute
};
-#endif /* CH_USE_SEMAPHORES */
+#endif /* CH_CFG_USE_SEMAPHORES */
/**
* @brief Test sequence for semaphores.
*/
ROMCONST struct testcase * ROMCONST patternsem[] = {
-#if CH_USE_SEMAPHORES || defined(__DOXYGEN__)
+#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
&testsem1,
&testsem2,
-#if CH_USE_SEMSW || defined(__DOXYGEN__)
+#if CH_CFG_USE_SEMSW || defined(__DOXYGEN__)
&testsem3,
#endif
&testsem4,
diff --git a/test/testthd.c b/test/testthd.c
index 9916ca253..af71a2041 100644
--- a/test/testthd.c
+++ b/test/testthd.c
@@ -119,7 +119,7 @@ ROMCONST struct testcase testthd2 = {
* <h2>Description</h2>
* A series of priority changes are performed on the current thread in order
* to verify that the priority change happens as expected.<br>
- * If the @p CH_USE_MUTEXES option is enabled then the priority changes are
+ * If the @p CH_CFG_USE_MUTEXES option is enabled then the priority changes are
* also tested under priority inheritance boosted priority state.
*/
@@ -138,7 +138,7 @@ static void thd3_execute(void) {
test_assert(4, chThdGetPriority() == prio,
"unexpected priority level");
-#if CH_USE_MUTEXES || defined(__DOXYGEN__)
+#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
/* Simulates a priority boost situation (p_prio > p_realprio).*/
chSysLock();
chThdSelf()->p_prio += 2;