You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/01/11 13:12:34 UTC
[nuttx] branch master updated: sensors/bmi160.c: fix i2C read and write behavior
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 1ce93a7d9a sensors/bmi160.c: fix i2C read and write behavior
1ce93a7d9a is described below
commit 1ce93a7d9a22f3bc7f27ef6efcf097daf2f56168
Author: xinbingnan <xi...@xiaomi.com>
AuthorDate: Mon Dec 26 17:29:21 2022 +0800
sensors/bmi160.c: fix i2C read and write behavior
There is a problem with the original driver reading and writing behavior, refer to the driver of mpu60x0 to make corresponding changes.
Signed-off-by: xinbingnan <xi...@xiaomi.com>
---
drivers/sensors/bmi160.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/sensors/bmi160.c b/drivers/sensors/bmi160.c
index 02319e3716..bc938c1d4a 100644
--- a/drivers/sensors/bmi160.c
+++ b/drivers/sensors/bmi160.c
@@ -303,7 +303,7 @@ static uint8_t bmi160_getreg8(FAR struct bmi160_dev_s *priv, uint8_t regaddr)
msg[0].frequency = priv->freq;
msg[0].addr = priv->addr;
- msg[0].flags = 0;
+ msg[0].flags = I2C_M_NOSTOP;
msg[0].buffer = ®addr;
msg[0].length = 1;
@@ -422,7 +422,7 @@ static uint16_t bmi160_getreg16(FAR struct bmi160_dev_s *priv,
msg[0].frequency = priv->freq;
msg[0].addr = priv->addr;
- msg[0].flags = 0;
+ msg[0].flags = I2C_M_NOSTOP;
msg[0].buffer = ®addr;
msg[0].length = 1;
@@ -482,7 +482,7 @@ static void bmi160_getregs(FAR struct bmi160_dev_s *priv, uint8_t regaddr,
msg[0].frequency = priv->freq;
msg[0].addr = priv->addr;
- msg[0].flags = 0;
+ msg[0].flags = I2C_M_NOSTOP;
msg[0].buffer = ®addr;
msg[0].length = 1;