From d838ea596f23b80badbaffe318561ce15ba7491a Mon Sep 17 00:00:00 2001 From: Diego Herranz Date: Tue, 8 Dec 2020 20:54:36 +0000 Subject: [PATCH] boards/arm/stm32/common: devpath not long enough for apa102 and veml6070 Also header path updated in drivers/leds/apa102.c --- boards/arm/stm32/common/src/stm32_apa102.c | 4 ++-- boards/arm/stm32/common/src/stm32_veml6070.c | 4 ++-- drivers/leds/apa102.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/boards/arm/stm32/common/src/stm32_apa102.c b/boards/arm/stm32/common/src/stm32_apa102.c index 37f0bd1721..a325b5b8e0 100644 --- a/boards/arm/stm32/common/src/stm32_apa102.c +++ b/boards/arm/stm32/common/src/stm32_apa102.c @@ -82,7 +82,7 @@ int board_apa102_initialize(int devno, int spino) { FAR struct spi_dev_s *spi; - char devpath[12]; + char devpath[13]; int ret; spi = stm32_spibus_initialize(spino); @@ -93,7 +93,7 @@ int board_apa102_initialize(int devno, int spino) /* Register the APA102 Driver at the specified location. */ - snprintf(devpath, 12, "/dev/leddrv%d", devno); + snprintf(devpath, 13, "/dev/leddrv%d", devno); ret = apa102_register(devpath, spi); if (ret < 0) { diff --git a/boards/arm/stm32/common/src/stm32_veml6070.c b/boards/arm/stm32/common/src/stm32_veml6070.c index a2850f1042..cff493a803 100644 --- a/boards/arm/stm32/common/src/stm32_veml6070.c +++ b/boards/arm/stm32/common/src/stm32_veml6070.c @@ -83,7 +83,7 @@ int board_veml6070_initialize(int devno, int busno) { FAR struct i2c_master_s *i2c; - char devpath[13]; + char devpath[14]; int ret; sninfo("Initializing VEML6070!\n"); @@ -99,7 +99,7 @@ int board_veml6070_initialize(int devno, int busno) /* Then register the light sensor */ - snprintf(devpath, 13, "/dev/uvlight%d", devno); + snprintf(devpath, 14, "/dev/uvlight%d", devno); ret = veml6070_register(devpath, i2c, VEML6070_I2C_DATA_LSB_CMD_ADDR); if (ret < 0) { diff --git a/drivers/leds/apa102.c b/drivers/leds/apa102.c index 6b40f4f8a4..e3ba1efcd4 100644 --- a/drivers/leds/apa102.c +++ b/drivers/leds/apa102.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/sensors/apa102.c + * drivers/leds/apa102.c * Character driver to control LED strips with APA102. * * Copyright (C) 2017 Gregory Nutt. All rights reserved.