From cab072b84d0b2bc9285e6ec14b2df41992259d4a Mon Sep 17 00:00:00 2001 From: dongjiuzhu Date: Tue, 17 Nov 2020 14:03:26 +0800 Subject: [PATCH] board/stm32f429i: support l3gd20 sensor with new sensor model Signed-off-by: dongjiuzhu --- 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 0aca79a993..8b38ebd9b6 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 ac1e8eeb96..e32cfb12c5 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;