aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-01-15 20:20:09 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-01-15 20:20:09 +0000
commit8c55bff0adfcbe032123202788492f4e8715beef (patch)
treec6ce7fb34b7c508cd02920fc40ff5a6fd78b96fb /os/hal/src
parentfc79c25a3539dce82945e7fe909ad681f533c770 (diff)
downloadChibiOS-8c55bff0adfcbe032123202788492f4e8715beef.tar.gz
ChibiOS-8c55bff0adfcbe032123202788492f4e8715beef.tar.bz2
ChibiOS-8c55bff0adfcbe032123202788492f4e8715beef.zip
Added missing check.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11281 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/hal_spi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/os/hal/src/hal_spi.c b/os/hal/src/hal_spi.c
index 64d03e9c1..5860e4156 100644
--- a/os/hal/src/hal_spi.c
+++ b/os/hal/src/hal_spi.c
@@ -324,7 +324,9 @@ void spiAbort(SPIDriver *spip) {
void spiIgnore(SPIDriver *spip, size_t n) {
osalDbgCheck((spip != NULL) && (n > 0U));
+#if SPI_SUPPORTS_CIRCULAR
osalDbgCheck((spip->config->circular == false) || ((n & 1U) == 0U));
+#endif
osalSysLock();
osalDbgAssert(spip->state == SPI_READY, "not ready");
@@ -356,7 +358,9 @@ void spiExchange(SPIDriver *spip, size_t n,
osalDbgCheck((spip != NULL) && (n > 0U) &&
(rxbuf != NULL) && (txbuf != NULL));
+#if SPI_SUPPORTS_CIRCULAR
osalDbgCheck((spip->config->circular == false) || ((n & 1U) == 0U));
+#endif
osalSysLock();
osalDbgAssert(spip->state == SPI_READY, "not ready");
@@ -384,7 +388,9 @@ void spiExchange(SPIDriver *spip, size_t n,
void spiSend(SPIDriver *spip, size_t n, const void *txbuf) {
osalDbgCheck((spip != NULL) && (n > 0U) && (txbuf != NULL));
+#if SPI_SUPPORTS_CIRCULAR
osalDbgCheck((spip->config->circular == false) || ((n & 1U) == 0U));
+#endif
osalSysLock();
osalDbgAssert(spip->state == SPI_READY, "not ready");
@@ -412,7 +418,9 @@ void spiSend(SPIDriver *spip, size_t n, const void *txbuf) {
void spiReceive(SPIDriver *spip, size_t n, void *rxbuf) {
osalDbgCheck((spip != NULL) && (n > 0U) && (rxbuf != NULL));
+#if SPI_SUPPORTS_CIRCULAR
osalDbgCheck((spip->config->circular == false) || ((n & 1U) == 0U));
+#endif
osalSysLock();
osalDbgAssert(spip->state == SPI_READY, "not ready");