From ee3072bcf8c4fc277f82b2a5e20cd9bcdbc29aca Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 16 Dec 2018 07:57:53 +0000 Subject: Fixed problem in I2Cv3 http://www.chibios.com/forum/viewtopic.php?f=35&t=4933 git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12472 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'os/hal/ports') diff --git a/os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.c b/os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.c index a7e0f589b..3ddeca982 100644 --- a/os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.c +++ b/os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.c @@ -983,9 +983,24 @@ void i2c_lld_stop(I2CDriver *i2cp) { /* I2C disable.*/ i2c_lld_abort_operation(i2cp); -#if STM32_I2C_USE_DMA == TRUE - i2c_lld_stop_tx_dma(i2cp); - i2c_lld_stop_rx_dma(i2cp); + +#if defined(STM32_I2C_DMA_REQUIRED) && defined(STM32_I2C_BDMA_REQUIRED) + if(i2cp->is_bdma) +#endif +#if defined(STM32_I2C_BDMA_REQUIRED) + { + bdmaStreamRelease(i2cp->rx.bdma); + bdmaStreamRelease(i2cp->tx.bdma); + } +#endif +#if defined(STM32_I2C_DMA_REQUIRED) && defined(STM32_I2C_BDMA_REQUIRED) + else +#endif +#if defined(STM32_I2C_DMA_REQUIRED) + { + dmaStreamRelease(i2cp->rx.dma); + dmaStreamRelease(i2cp->tx.dma); + } #endif #if STM32_I2C_USE_I2C1 -- cgit v1.2.3