gustavonihei commented on code in PR #6468:
URL: https://github.com/apache/incubator-nuttx/pull/6468#discussion_r901034916


##########
arch/risc-v/src/esp32c3/esp32c3_i2c.c:
##########
@@ -1037,14 +1037,32 @@ static int esp32c3_i2c_transfer(struct i2c_master_s 
*dev,
 
       esp32c3_i2c_init_clock(priv, msgs[i].frequency);
 
-      /* Reset I2C trace logic */
+      if ((msgs[i].flags & I2C_M_NOSTART) != 0)
+        {
+          esp32c3_i2c_traceevent(priv, I2CEVENT_SENDBYTE, priv->bytes,
+                                 getreg32(I2C_SR_REG(priv->id)));
+          esp32c3_i2c_senddata(priv);
+
+          if (priv->bytes == msgs[i].length)
+            {
+              priv->i2cstate = I2CSTATE_STOP;
+              if ((msgs[i].flags & I2C_M_NOSTOP) != 0)
+                {
+                  priv->i2cstate = I2CSTATE_FINISH;
+                }

Review Comment:
   ```suggestion
                 if ((msgs[i].flags & I2C_M_NOSTOP) == 0)
                   {
                     priv->i2cstate = I2CSTATE_STOP;
                   }
   #ifndef CONFIG_I2C_POLLED
                 else
                   {
                     priv->i2cstate = I2CSTATE_FINISH;
                   }
   #endif
   ```
   `I2CSTATE_FINISH` does not apply for Polled I2C.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to