Added missing check.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11281 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2018-01-15 20:20:09 +00:00
parent fc79c25a35
commit 8c55bff0ad
1 changed files with 8 additions and 0 deletions

View File

@ -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");