aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-04-17 16:22:44 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-04-17 16:22:44 +0000
commite2dbf2c514226554968e0e984201d2859011bd62 (patch)
tree7a36b0e6bfe600398e9ca2f423ba012dfd41ef16 /os/hal/ports/STM32/LLD
parent33e5baffbde66053bc8780d6ab6a5d8768c28918 (diff)
downloadChibiOS-e2dbf2c514226554968e0e984201d2859011bd62.tar.gz
ChibiOS-e2dbf2c514226554968e0e984201d2859011bd62.tar.bz2
ChibiOS-e2dbf2c514226554968e0e984201d2859011bd62.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7904 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/LLD')
-rw-r--r--os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c13
1 files changed, 5 insertions, 8 deletions
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;