From 8c55bff0adfcbe032123202788492f4e8715beef Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 15 Jan 2018 20:20:09 +0000 Subject: Added missing check. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11281 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/hal_spi.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'os/hal/src/hal_spi.c') 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"); -- cgit v1.2.3