aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/hal_buffers.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-12-02 15:09:24 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-12-02 15:09:24 +0000
commit0f8c6b90f7c4e43beaa83ce2e694980952a79b9f (patch)
treea96cc9b9e5486bef4b8503641a7e068430b7376a /os/hal/include/hal_buffers.h
parent559b4aa2d31e6bc4bbf9fbb7202608fefc5a57cc (diff)
downloadChibiOS-0f8c6b90f7c4e43beaa83ce2e694980952a79b9f.tar.gz
ChibiOS-0f8c6b90f7c4e43beaa83ce2e694980952a79b9f.tar.bz2
ChibiOS-0f8c6b90f7c4e43beaa83ce2e694980952a79b9f.zip
New buffers performance tuning option added.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12456 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/include/hal_buffers.h')
-rw-r--r--os/hal/include/hal_buffers.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/os/hal/include/hal_buffers.h b/os/hal/include/hal_buffers.h
index 164ab82bc..9c5ea42d6 100644
--- a/os/hal/include/hal_buffers.h
+++ b/os/hal/include/hal_buffers.h
@@ -33,10 +33,24 @@
/* Driver pre-compile time settings. */
/*===========================================================================*/
+/**
+ * @brief Maximum size of blocks copied in critical sections.
+ * @note Increasing this value increases performance at expense of
+ * IRQ servicing efficiency.
+ * @note It must be a power of two.
+ */
+#if !defined(BUFFERS_CHUNKS_SIZE) || defined(__DOXYGEN__)
+#define BUFFERS_CHUNKS_SIZE 64
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
+#if (BUFFERS_CHUNKS_SIZE & (BUFFERS_CHUNKS_SIZE - 1)) != 0
+#error "BUFFERS_CHUNKS_SIZE must be a power of two"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/