aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/oslib/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-02-06 19:11:03 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-02-06 19:11:03 +0000
commitea1e31e8be764309f24ebb3ec3cbac49e2e12212 (patch)
treef31f42d773953d40f73afc10b43bfc1805dca21f /os/common/oslib/include
parentd0fa882cdc74af4fad5b1a44e10bca44e83429a1 (diff)
downloadChibiOS-ea1e31e8be764309f24ebb3ec3cbac49e2e12212.tar.gz
ChibiOS-ea1e31e8be764309f24ebb3ec3cbac49e2e12212.tar.bz2
ChibiOS-ea1e31e8be764309f24ebb3ec3cbac49e2e12212.zip
MISRA-related fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11459 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/common/oslib/include')
-rw-r--r--os/common/oslib/include/chfactory.h36
-rw-r--r--os/common/oslib/include/chfifo.h4
2 files changed, 27 insertions, 13 deletions
diff --git a/os/common/oslib/include/chfactory.h b/os/common/oslib/include/chfactory.h
index a2f27c626..1843d6a36 100644
--- a/os/common/oslib/include/chfactory.h
+++ b/os/common/oslib/include/chfactory.h
@@ -90,8 +90,30 @@
/* Derived constants and error checks. */
/*===========================================================================*/
+#if (CH_CFG_FACTORY_SEMAPHORES == TRUE) && (CH_CFG_USE_SEMAPHORES == FALSE)
+/*lint -save -e767 [20.5] Valid because the #undef.*/
+#undef CH_CFG_FACTORY_SEMAPHORES
+#define CH_CFG_FACTORY_SEMAPHORES FALSE
+/*lint restore*/
+#endif
+
+#if (CH_CFG_FACTORY_MAILBOXES == TRUE) && (CH_CFG_USE_MAILBOXES == FALSE)
+/*lint -save -e767 [20.5] Valid because the #undef.*/
+#undef CH_CFG_FACTORY_MAILBOXES
+#define CH_CFG_FACTORY_MAILBOXES FALSE
+/*lint restore*/
+#endif
+
+#if (CH_CFG_FACTORY_OBJ_FIFOS == TRUE) && (CH_CFG_USE_OBJ_FIFOS == FALSE)
+/*lint -save -e767 [20.5] Valid because the #undef.*/
+#undef CH_CFG_FACTORY_OBJ_FIFOS
+#define CH_CFG_FACTORY_OBJ_FIFOS FALSE
+/*lint restore*/
+#endif
+
#define CH_FACTORY_REQUIRES_POOLS \
- ((CH_CFG_FACTORY_SEMAPHORES == TRUE))
+ ((CH_CFG_FACTORY_OBJECTS_REGISTRY == TRUE) || \
+ (CH_CFG_FACTORY_SEMAPHORES == TRUE))
#define CH_FACTORY_REQUIRES_HEAP \
((CH_CFG_FACTORY_GENERIC_BUFFERS == TRUE) || \
@@ -119,18 +141,6 @@
#error "CH_CFG_USE_HEAP is required"
#endif
-#if (CH_CFG_FACTORY_SEMAPHORES == TRUE) && (CH_CFG_USE_SEMAPHORES == FALSE)
-#error "CH_CFG_FACTORY_SEMAPHORES requires CH_CFG_USE_SEMAPHORES"
-#endif
-
-#if (CH_CFG_FACTORY_MAILBOXES == TRUE) && (CH_CFG_USE_MAILBOXES == FALSE)
-#error "CH_CFG_FACTORY_MAILBOXES requires CH_CFG_USE_MAILBOXES"
-#endif
-
-#if (CH_CFG_FACTORY_OBJ_FIFOS == TRUE) && (CH_CFG_USE_OBJ_FIFOS == FALSE)
-#error "CH_CFG_FACTORY_OBJ_FIFOS requires CH_CFG_USE_OBJ_FIFOS"
-#endif
-
/*===========================================================================*/
/* Module data structures and types. */
/*===========================================================================*/
diff --git a/os/common/oslib/include/chfifo.h b/os/common/oslib/include/chfifo.h
index 17972392e..11ca3631d 100644
--- a/os/common/oslib/include/chfifo.h
+++ b/os/common/oslib/include/chfifo.h
@@ -70,6 +70,10 @@
#error "CH_CFG_USE_OBJ_FIFOS requires CH_CFG_USE_SEMAPHORES"
#endif
+#if CH_CFG_USE_MAILBOXES == FALSE
+#error "CH_CFG_USE_OBJ_FIFOS requires CH_CFG_USE_MAILBOXES"
+#endif
+
/*===========================================================================*/
/* Module data structures and types. */
/*===========================================================================*/