From dcf4b4b689cef6408e3138bb3cfa6adbbb82cb85 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 5 Dec 2018 15:38:42 -0600 Subject: [PATCH] STM32H7 and STM32L4: Applied David Sidrane's I2C to: arch/arm/src/stm32h7/stm32_i2c.c arch/arm/src/stm32l4/stm32l4_i2c.c Those easy because F7 patch applied with no problem (after changing path and file names appropriately). The patch could not be appleed to the following. The logic is different. I don't know if a similar change is needed there or not. arch/arm/src/stm32/stm32f30xxx_i2c.c arch/arm/src/stm32/stm32f40xxx_i2c.c arch/arm/src/stm32/stm32_i2c.c arch/arm/src/stm32/stm32_i2c_alt.c arch/arm/src/stm32f0/stm32f0_i2c.c --- arch/arm/src/stm32h7/stm32_i2c.c | 4 +++- arch/arm/src/stm32l4/stm32l4_i2c.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/stm32h7/stm32_i2c.c b/arch/arm/src/stm32h7/stm32_i2c.c index 14ea09e6313..042e45ceee6 100644 --- a/arch/arm/src/stm32h7/stm32_i2c.c +++ b/arch/arm/src/stm32h7/stm32_i2c.c @@ -1423,7 +1423,9 @@ static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv) * it otherwise. */ - if (priv->msgc > 0) + /* Check if there are multiple messages and the next is a continuation */ + + if (priv->msgc > 1) { next_norestart = (((priv->msgv + 1)->flags & I2C_M_NOSTART) != 0); } diff --git a/arch/arm/src/stm32l4/stm32l4_i2c.c b/arch/arm/src/stm32l4/stm32l4_i2c.c index 8bce93048f9..7df5e2c892c 100644 --- a/arch/arm/src/stm32l4/stm32l4_i2c.c +++ b/arch/arm/src/stm32l4/stm32l4_i2c.c @@ -1593,7 +1593,9 @@ static inline void stm32l4_i2c_sendstart(FAR struct stm32l4_i2c_priv_s *priv) * it otherwise. */ - if (priv->msgc > 0) + /* Check if there are multiple messages and the next is a continuation */ + + if (priv->msgc > 1) { next_norestart = (((priv->msgv + 1)->flags & I2C_M_NOSTART) != 0); }