diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-05-28 13:24:17 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-05-28 13:24:17 +0000 |
commit | dce45c502e691cc8ec98bc7c88a4922aedfcb76d (patch) | |
tree | 2c558718794bb5a27c8f54bec5d97f670d9bf66c /os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c | |
parent | 6f500a998692ede3a5a6a8a007dfc5e885bdd48c (diff) | |
download | ChibiOS-dce45c502e691cc8ec98bc7c88a4922aedfcb76d.tar.gz ChibiOS-dce45c502e691cc8ec98bc7c88a4922aedfcb76d.tar.bz2 ChibiOS-dce45c502e691cc8ec98bc7c88a4922aedfcb76d.zip |
Fixed bug #825.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10212 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c')
-rw-r--r-- | os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c b/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c index 4512dabe8..914249fe7 100644 --- a/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c +++ b/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c @@ -515,6 +515,8 @@ void spi_lld_unselect(SPIDriver *spip) { */
void spi_lld_ignore(SPIDriver *spip, size_t n) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, &dummyrx);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode);
@@ -545,6 +547,8 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { void spi_lld_exchange(SPIDriver *spip, size_t n,
const void *txbuf, void *rxbuf) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, rxbuf);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode | STM32_DMA_CR_MINC);
@@ -572,6 +576,8 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, */
void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, &dummyrx);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode);
@@ -599,6 +605,8 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { */
void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, rxbuf);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode | STM32_DMA_CR_MINC);
|