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 2020/11/20 02:13:25 UTC

[incubator-nuttx] 02/02: board/stm32f429i: support l3gd20 sensor with new sensor model

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/incubator-nuttx.git

commit cab072b84d0b2bc9285e6ec14b2df41992259d4a
Author: dongjiuzhu <do...@xiaomi.com>
AuthorDate: Tue Nov 17 14:03:26 2020 +0800

    board/stm32f429i: support l3gd20 sensor with new sensor model
    
    Signed-off-by: dongjiuzhu <do...@xiaomi.com>
---
 boards/arm/stm32/common/include/stm32_l3gd20.h | 3 ++-
 boards/arm/stm32/common/src/stm32_l3gd20.c     | 7 +++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/boards/arm/stm32/common/include/stm32_l3gd20.h b/boards/arm/stm32/common/include/stm32_l3gd20.h
index 0aca79a..8b38ebd 100644
--- a/boards/arm/stm32/common/include/stm32_l3gd20.h
+++ b/boards/arm/stm32/common/include/stm32_l3gd20.h
@@ -62,7 +62,8 @@ extern "C"
  *   Initialize and register the L3GD20 3 axis gyroscope sensor driver.
  *
  * Input Parameters:
- *   devno - The device number, used to build the device path as /dev/gyroN
+ *   devno - The device number, used to build the device path as
+ *           /dev/sensor/gyro_uncalN
  *   busno - The SPI bus number
  *
  * Returned Value:
diff --git a/boards/arm/stm32/common/src/stm32_l3gd20.c b/boards/arm/stm32/common/src/stm32_l3gd20.c
index ac1e8ee..e32cfb1 100644
--- a/boards/arm/stm32/common/src/stm32_l3gd20.c
+++ b/boards/arm/stm32/common/src/stm32_l3gd20.c
@@ -86,7 +86,8 @@ static int l3gd20_attach(FAR struct l3gd20_config_s *cfg, xcpt_t irq)
  *   Initialize and register the L3GD20 3 axis gyroscope sensor driver.
  *
  * Input Parameters:
- *   devno - The device number, used to build the device path as /dev/gyroN
+ *   devno - The device number, used to build the device path as
+ *           /dev/sensor/gyro_uncalN
  *   busno - The SPI bus number
  *
  * Returned Value:
@@ -98,7 +99,6 @@ int board_l3gd20_initialize(int devno, int busno)
 {
   int ret = 0;
   struct spi_dev_s *spi;
-  char devpath[12];
 
   /* Configure DREADY IRQ input */
 
@@ -116,8 +116,7 @@ int board_l3gd20_initialize(int devno, int busno)
 
   /* Then register the gyro */
 
-  snprintf(devpath, 12, "/dev/gyro%d", devno);
-  ret = l3gd20_register(devpath, spi, &g_l3gd20_config);
+  ret = l3gd20_register(devno, spi, &g_l3gd20_config);
   if (ret != OK)
     {
       goto errout;