aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-09-26 08:46:17 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-09-26 08:46:17 +0000
commit85621dde08560b98cb82dceebb2c52dd44e672cc (patch)
treef720cc92d01af8143e10e12dd1ed32a290676039
parent3864014e03b6c411613e50e90617f49c016c5aaa (diff)
downloadChibiOS-85621dde08560b98cb82dceebb2c52dd44e672cc.tar.gz
ChibiOS-85621dde08560b98cb82dceebb2c52dd44e672cc.tar.bz2
ChibiOS-85621dde08560b98cb82dceebb2c52dd44e672cc.zip
More renaming.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10716 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--demos/STM32/RT-STM32F303-DISCOVERY/chconf.h9
-rw-r--r--os/common/oslib/include/chfactory.h16
-rw-r--r--os/common/oslib/src/chfactory.c6
3 files changed, 20 insertions, 11 deletions
diff --git a/demos/STM32/RT-STM32F303-DISCOVERY/chconf.h b/demos/STM32/RT-STM32F303-DISCOVERY/chconf.h
index ad6b53ade..71d3ae844 100644
--- a/demos/STM32/RT-STM32F303-DISCOVERY/chconf.h
+++ b/demos/STM32/RT-STM32F303-DISCOVERY/chconf.h
@@ -295,6 +295,15 @@
#define CH_CFG_USE_MEMPOOLS TRUE
/**
+ * @brief Objects factory APIs.
+ * @details If enabled then the objects factory APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_FACTORY TRUE
+
+/**
* @brief Dynamic Threads APIs.
* @details If enabled then the dynamic threads creation APIs are included
* in the kernel.
diff --git a/os/common/oslib/include/chfactory.h b/os/common/oslib/include/chfactory.h
index b06fbcf64..04a59a721 100644
--- a/os/common/oslib/include/chfactory.h
+++ b/os/common/oslib/include/chfactory.h
@@ -51,8 +51,8 @@
* @brief Enables factory for generic objects.
* @note Generic objects require the heap allocator.
*/
-#if !defined(CH_CFG_FACTORY_GENERIC) || defined(__DOXYGEN__)
-#define CH_CFG_FACTORY_GENERIC TRUE
+#if !defined(CH_CFG_FACTORY_GENERIC_BUFFER) || defined(__DOXYGEN__)
+#define CH_CFG_FACTORY_GENERIC_BUFFER TRUE
#endif
/**
@@ -70,7 +70,7 @@
((CH_CFG_FACTORY_SEMAPHORES == TRUE))
#define CH_FACTORY_REQUIRES_HEAP \
- ((CH_CFG_FACTORY_GENERIC == TRUE))
+ ((CH_CFG_FACTORY_GENERIC_BUFFER == TRUE))
#if (CH_CFG_FACTORY_MAX_NAMES_LENGHT < 0) || \
(CH_CFG_FACTORY_MAX_NAMES_LENGHT > 32)
@@ -123,7 +123,7 @@ typedef struct ch_dyn_list {
dyn_element_t *next;
} dyn_list_t;
-#if (CH_CFG_FACTORY_GENERIC == TRUE) || defined(__DOXIGEN__)
+#if (CH_CFG_FACTORY_GENERIC_BUFFER == TRUE) || defined(__DOXIGEN__)
/**
* @brief Type of a dynamic semaphore.
*/
@@ -160,12 +160,12 @@ typedef struct ch_dyn_semaphore {
* @brief Type of the factory main object.
*/
typedef struct ch_objects_factory {
-#if (CH_CFG_FACTORY_GENERIC == TRUE) || defined(__DOXIGEN__)
+#if (CH_CFG_FACTORY_GENERIC_BUFFER == TRUE) || defined(__DOXIGEN__)
/**
* @brief List of the allocated objects.
*/
dyn_list_t obj_list;
-#endif /* CH_CFG_FACTORY_GENERIC = TRUE */
+#endif /* CH_CFG_FACTORY_GENERIC_BUFFER = TRUE */
#if (CH_CFG_FACTORY_SEMAPHORES == TRUE) || defined(__DOXIGEN__)
/**
* @brief List of the allocated semaphores.
@@ -196,7 +196,7 @@ extern "C" {
void _factory_init(void);
// dyn_registered_object_t *chFactoryRegisterObject(const char *name,
// void *objp);
-#if (CH_CFG_FACTORY_GENERIC == TRUE) || defined(__DOXIGEN__)
+#if (CH_CFG_FACTORY_GENERIC_BUFFER == TRUE) || defined(__DOXIGEN__)
dyn_buffer_t *chFactoryCreateBuffer(const char *name, size_t size);
dyn_buffer_t *chFactoryFindBuffer(const char *name);
void chFactoryReleaseBuffer(dyn_buffer_t *dbp);
@@ -231,7 +231,7 @@ static inline dyn_element_t *chFactoryDuplicateReferenceI(dyn_element_t *dep) {
return dep;
}
-#if (CH_CFG_FACTORY_GENERIC == TRUE) || defined(__DOXIGEN__)
+#if (CH_CFG_FACTORY_GENERIC_BUFFER == TRUE) || defined(__DOXIGEN__)
/**
* @brief Returns the size of a generic dynamic buffer object.
*
diff --git a/os/common/oslib/src/chfactory.c b/os/common/oslib/src/chfactory.c
index c4e6268d9..22a643574 100644
--- a/os/common/oslib/src/chfactory.c
+++ b/os/common/oslib/src/chfactory.c
@@ -119,7 +119,7 @@ static dyn_element_t *dyn_list_unlink(dyn_list_t *dlp, dyn_element_t *element) {
*/
void _factory_init(void) {
-#if CH_CFG_FACTORY_GENERIC == TRUE
+#if CH_CFG_FACTORY_GENERIC_BUFFER == TRUE
dyn_list_init(&ch_factory.obj_list);
#endif
#if CH_CFG_FACTORY_SEMAPHORES == TRUE
@@ -130,7 +130,7 @@ void _factory_init(void) {
#endif
}
-#if (CH_CFG_FACTORY_GENERIC == TRUE) || defined(__DOXIGEN__)
+#if (CH_CFG_FACTORY_GENERIC_BUFFER == TRUE) || defined(__DOXIGEN__)
/**
* @brief Creates a generic dynamic buffer object.
* @post A reference to the buffer object is returned and the reference
@@ -247,7 +247,7 @@ void chFactoryReleaseBuffer(dyn_buffer_t *dbp) {
chSysUnlock();
}
-#endif /* CH_CFG_FACTORY_GENERIC = TRUE */
+#endif /* CH_CFG_FACTORY_GENERIC_BUFFER = TRUE */
#if (CH_CFG_FACTORY_SEMAPHORES == TRUE) || defined(__DOXIGEN__)
/**