From 4031ccce3ae6544e81f1b26f8e407efb15594278 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 14 Nov 2015 18:38:36 +0000 Subject: Fixed bug #671. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8490 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'os/hal') diff --git a/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c b/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c index e0bc31979..991e77b01 100644 --- a/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c +++ b/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c @@ -844,8 +844,11 @@ void i2c_lld_start(I2CDriver *i2cp) { #endif /* Reset i2c peripheral, the TCIE bit will be handled separately.*/ - dp->CR1 = i2cp->config->cr1 | I2C_CR1_ERRIE | I2C_CR1_NACKIE | - I2C_CR1_TXDMAEN | I2C_CR1_RXDMAEN; + dp->CR1 = i2cp->config->cr1 | +#if STM32_I2C_USE_DMA == TRUE + I2C_CR1_TXDMAEN | I2C_CR1_RXDMAEN | /* Enable only if using DMA */ +#endif + I2C_CR1_ERRIE | I2C_CR1_NACKIE; /* Setup I2C parameters.*/ dp->TIMINGR = i2cp->config->timingr; -- cgit v1.2.3