diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-01-09 15:51:12 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-01-09 15:51:12 +0000 |
commit | 14b747019236d1417d3ef9bc885ec777dc26d35f (patch) | |
tree | 74ba5440f2f1d20a58cca96079f9908ec9d18292 | |
parent | 7e46dc94aa5d6bad9ff7e449878f64938b2437f1 (diff) | |
download | ChibiOS-14b747019236d1417d3ef9bc885ec777dc26d35f.tar.gz ChibiOS-14b747019236d1417d3ef9bc885ec777dc26d35f.tar.bz2 ChibiOS-14b747019236d1417d3ef9bc885ec777dc26d35f.zip |
Added checks related to SPI circular mode.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11243 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/src/hal_spi.c | 4 | ||||
-rw-r--r-- | readme.txt | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/os/hal/src/hal_spi.c b/os/hal/src/hal_spi.c index da42b5e1d..64d03e9c1 100644 --- a/os/hal/src/hal_spi.c +++ b/os/hal/src/hal_spi.c @@ -324,6 +324,7 @@ void spiAbort(SPIDriver *spip) { void spiIgnore(SPIDriver *spip, size_t n) {
osalDbgCheck((spip != NULL) && (n > 0U));
+ osalDbgCheck((spip->config->circular == false) || ((n & 1U) == 0U));
osalSysLock();
osalDbgAssert(spip->state == SPI_READY, "not ready");
@@ -355,6 +356,7 @@ void spiExchange(SPIDriver *spip, size_t n, osalDbgCheck((spip != NULL) && (n > 0U) &&
(rxbuf != NULL) && (txbuf != NULL));
+ osalDbgCheck((spip->config->circular == false) || ((n & 1U) == 0U));
osalSysLock();
osalDbgAssert(spip->state == SPI_READY, "not ready");
@@ -382,6 +384,7 @@ void spiExchange(SPIDriver *spip, size_t n, void spiSend(SPIDriver *spip, size_t n, const void *txbuf) {
osalDbgCheck((spip != NULL) && (n > 0U) && (txbuf != NULL));
+ osalDbgCheck((spip->config->circular == false) || ((n & 1U) == 0U));
osalSysLock();
osalDbgAssert(spip->state == SPI_READY, "not ready");
@@ -409,6 +412,7 @@ 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));
+ osalDbgCheck((spip->config->circular == false) || ((n & 1U) == 0U));
osalSysLock();
osalDbgAssert(spip->state == SPI_READY, "not ready");
diff --git a/readme.txt b/readme.txt index d800ceb81..7cefce13c 100644 --- a/readme.txt +++ b/readme.txt @@ -89,6 +89,7 @@ *****************************************************************************
*** Next ***
+- NEW: Added circular continuous mode to the SPI driver.
- NEW: Added callbacks capability to the CAN driver.
- NEW: Added initial STM32H7xx support.
- NEW: Added GHS compiler support to the Power e200 port.
|