From e2dbf2c514226554968e0e984201d2859011bd62 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Fri, 17 Apr 2015 16:22:44 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7904 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'os/hal/ports') diff --git a/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c b/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c index 1f320808b..dd09fb265 100644 --- a/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c +++ b/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c @@ -99,7 +99,7 @@ static void i2c_lld_set_address(I2CDriver *i2cp, i2caddr_t addr) { /* Address alignment depends on the addressing mode selected.*/ if ((i2cp->config->cr2 & I2C_CR2_ADD10) == 0U) - dp->CR2 = ((uint32_t)addr & 0x7FU) << 1U; + dp->CR2 = (uint32_t)addr << 1U; else dp->CR2 = (uint32_t)addr; } @@ -123,8 +123,8 @@ static void i2c_lld_setup_rx_transfer(I2CDriver *i2cp, size_t n) { reload = I2C_CR2_RELOAD; } else { - i2cp->tsize = 0; - reload = 0; + i2cp->tsize = 0U; + reload = 0U; } /* Configures the CR2 registers with both the calculated and static @@ -152,8 +152,8 @@ static void i2c_lld_setup_tx_transfer(I2CDriver *i2cp, size_t n) { reload = I2C_CR2_RELOAD; } else { - i2cp->tsize = 0; - reload = 0; + i2cp->tsize = 0U; + reload = 0U; } /* Configures the CR2 registers with both the calculated and static @@ -537,9 +537,6 @@ void i2c_lld_start(I2CDriver *i2cp) { dp->CR1 = i2cp->config->cr1 | I2C_CR1_ERRIE | I2C_CR1_NACKIE | I2C_CR1_TXDMAEN | I2C_CR1_RXDMAEN; - /* Set slave address field (master mode) */ - dp->CR2 = (i2cp->config->cr2 & ~I2C_CR2_SADD); - /* Setup I2C parameters.*/ dp->TIMINGR = i2cp->config->timingr; -- cgit v1.2.3