You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2023/03/12 14:00:02 UTC

[nuttx] branch master updated: sensor/mpu60x0: Fix some error bit and width macro

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko 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 474bcedbd4 sensor/mpu60x0: Fix some error bit and width macro
474bcedbd4 is described below

commit 474bcedbd452b181c46949853114e35050800e8e
Author: zouboan <ff...@feedforward.com.cn>
AuthorDate: Sun Mar 12 15:22:36 2023 +0800

    sensor/mpu60x0: Fix some error bit and width macro
---
 drivers/sensors/mpu60x0.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/sensors/mpu60x0.c b/drivers/sensors/mpu60x0.c
index 4472ca1f9c..7cc6072157 100644
--- a/drivers/sensors/mpu60x0.c
+++ b/drivers/sensors/mpu60x0.c
@@ -55,7 +55,7 @@
 
 /* Creates a mask of @m bits, i.e. MASK(2) -> 00000011 */
 
-#define MASK(m) (BIT((m) + 1) - 1)
+#define MASK(m) (BIT(m) - 1)
 
 /* Masks and shifts @v into bit field @m */
 
@@ -90,14 +90,11 @@ enum mpu_regaddr_e
 
   CONFIG = 0x1a,
   CONFIG__EXT_SYNC_SET__SHIFT = 3,
-  CONFIG__EXT_SYNC_SET__WIDTH = 2,
+  CONFIG__EXT_SYNC_SET__WIDTH = 3,
   CONFIG__DLPF_CFG__SHIFT = 0,
-  CONFIG__DLPF_CFG__WIDTH = 2,
+  CONFIG__DLPF_CFG__WIDTH = 3,
 
   GYRO_CONFIG = 0x1b,
-  GYRO_CONFIG__XG_ST = BIT(7),
-  GYRO_CONFIG__YG_ST = BIT(6),
-  GYRO_CONFIG__ZG_ST = BIT(5),
   GYRO_CONFIG__FS_SEL__SHIFT = 3,
   GYRO_CONFIG__FS_SEL__WIDTH = 2,