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

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 0735bc16b95964c99b108045784253871318b032
Author: Ricard Rosson <[email protected]>
AuthorDate: Tue Aug 11 09:07:30 2026 +0100

    drivers/lcd: rename apa102.c/max7219.c to unique object names
    
    drivers/ is built by a single flat Makefile: every per-directory Make.defs
    appends its sources to one CSRCS list and its directory to one VPATH, and 
the
    objects all land in drivers/ named after the source basename.  Two sources
    with the same basename in different subdirectories therefore map to the same
    object, and make resolves the prerequisite through VPATH, which is searched
    in the order drivers/Makefile includes the Make.defs files.  lcd is included
    before leds, so drivers/lcd always wins.
    
    Both apa102 and max7219 exist twice, once as an LCD front-end and once as an
    LED driver:
    
      drivers/lcd/apa102.c   CONFIG_LCD_APA102    drivers/leds/apa102.c   
CONFIG_LEDS_APA102
      drivers/lcd/max7219.c  CONFIG_LCD_MAX7219   drivers/leds/max7219.c  
CONFIG_LEDS_MAX7219
    
    drivers/lcd/Make.defs puts lcd on the VPATH for the whole directory whenever
    CONFIG_LCD=y, so selecting only the LED driver still builds apa102.o from
    drivers/lcd/apa102.c and the selected LED driver is never compiled at all.
    Because the LCD front-ends take their constants from
    include/nuttx/lcd/apa102.h and include/nuttx/lcd/max7219.h, which are behind
    CONFIG_LCD_APA102 / CONFIG_LCD_MAX7219, the substituted source does not even
    compile.  With CONFIG_LCD=y + CONFIG_LEDS_APA102=y and CONFIG_LCD_APA102
    unset:
    
      lcd/apa102.c:701:20: error: 'APA102_BLACK' undeclared (first use in this
      function); did you mean 'APA102_BPP'?
    
    and correspondingly for CONFIG_LEDS_MAX7219 without CONFIG_LCD_MAX7219:
    
      lcd/max7219.c:773:20: error: 'MAX7219_BLACK' undeclared (first use in this
      function); did you mean 'MAX7219_BPP'?
    
    So neither LED driver can be built together with CONFIG_LCD, and there is no
    diagnostic pointing at the real cause.
    
    Give the LCD front-ends distinct basenames.  The LCD side is the adapted use
    of these parts (an LED matrix driven as a display), and drivers/lcd already
    names such variants for their role, e.g. ht16k33_14seg.c, so the suffix goes
    there and the LED drivers keep the plain part names.  The CMake build 
derives
    object paths from the source directory and was never affected; its source
    lists are updated to match.
    
    Signed-off-by: Ricard Rosson <[email protected]>
    Assisted-by: Claude Opus 5 (Claude Code)
---
 .github/CODEOWNERS                       | 4 ++--
 drivers/lcd/CMakeLists.txt               | 4 ++--
 drivers/lcd/Make.defs                    | 4 ++--
 drivers/lcd/{apa102.c => apa102_lcd.c}   | 2 +-
 drivers/lcd/{max7219.c => max7219_lcd.c} | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 6389d90e480..8f932f87c9b 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -13025,7 +13025,7 @@ drivers/ipcc/ipcc_register.c [email protected] 
[email protected] anjiah
 drivers/ipcc/ipcc_unlink.c [email protected] [email protected] 
[email protected] [email protected] [email protected]
 drivers/ipcc/ipcc_write.c [email protected] [email protected] 
[email protected] [email protected] [email protected]
 drivers/lcd/Kconfig [email protected] 
[email protected] [email protected]
-drivers/lcd/apa102.c [email protected] [email protected] 
[email protected] [email protected] [email protected]
+drivers/lcd/apa102_lcd.c [email protected] [email protected] 
[email protected] [email protected] [email protected]
 drivers/lcd/ft80x.c [email protected] [email protected] [email protected] 
[email protected]
 drivers/lcd/ft80x.h [email protected] [email protected] 
[email protected] [email protected]
 drivers/lcd/ft80x_spi.c [email protected] [email protected] 
[email protected]
@@ -13041,7 +13041,7 @@ drivers/lcd/lcd_dev.c [email protected] 
[email protected] rongyichang@
 drivers/lcd/lcd_framebuffer.c [email protected] [email protected] 
[email protected] [email protected]
 drivers/lcd/lcddrv_spiif.c [email protected] [email protected] 
[email protected] [email protected]
 drivers/lcd/lpm013m091a.c [email protected] [email protected] 
[email protected] [email protected]
-drivers/lcd/max7219.c [email protected] [email protected] 
[email protected] [email protected] [email protected]
+drivers/lcd/max7219_lcd.c [email protected] [email protected] 
[email protected] [email protected] [email protected]
 drivers/lcd/memlcd.c [email protected] [email protected] 
[email protected] [email protected]
 drivers/lcd/mio283qt2.c [email protected] [email protected] 
[email protected]
 drivers/lcd/mio283qt9a.c [email protected] [email protected] 
[email protected] [email protected]
diff --git a/drivers/lcd/CMakeLists.txt b/drivers/lcd/CMakeLists.txt
index 68e4e0ef4c6..192b6ac6115 100644
--- a/drivers/lcd/CMakeLists.txt
+++ b/drivers/lcd/CMakeLists.txt
@@ -50,7 +50,7 @@ if(CONFIG_LCD)
   endif()
 
   if(CONFIG_LCD_APA102)
-    list(APPEND SRCS apa102.c)
+    list(APPEND SRCS apa102_lcd.c)
   endif()
 
   if(CONFIG_LCD_P14201)
@@ -94,7 +94,7 @@ if(CONFIG_LCD)
   endif()
 
   if(CONFIG_LCD_MAX7219)
-    list(APPEND SRCS max7219.c)
+    list(APPEND SRCS max7219_lcd.c)
   endif()
 
   if(CONFIG_LCD_MIO283QT9A)
diff --git a/drivers/lcd/Make.defs b/drivers/lcd/Make.defs
index 081b5020195..baae957c571 100644
--- a/drivers/lcd/Make.defs
+++ b/drivers/lcd/Make.defs
@@ -48,7 +48,7 @@ ifeq ($(CONFIG_LCD_LPM013M091A),y)
 endif
 
 ifeq ($(CONFIG_LCD_APA102),y)
-  CSRCS += apa102.c
+  CSRCS += apa102_lcd.c
 endif
 
 ifeq ($(CONFIG_LCD_P14201),y)
@@ -92,7 +92,7 @@ ifeq ($(CONFIG_LCD_MIO283QT2),y)
 endif
 
 ifeq ($(CONFIG_LCD_MAX7219),y)
-  CSRCS += max7219.c
+  CSRCS += max7219_lcd.c
 endif
 
 ifeq ($(CONFIG_LCD_MIO283QT9A),y)
diff --git a/drivers/lcd/apa102.c b/drivers/lcd/apa102_lcd.c
similarity index 99%
rename from drivers/lcd/apa102.c
rename to drivers/lcd/apa102_lcd.c
index 619fa577e37..908fc44f50f 100644
--- a/drivers/lcd/apa102.c
+++ b/drivers/lcd/apa102_lcd.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/lcd/apa102.c
+ * drivers/lcd/apa102_lcd.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/drivers/lcd/max7219.c b/drivers/lcd/max7219_lcd.c
similarity index 99%
rename from drivers/lcd/max7219.c
rename to drivers/lcd/max7219_lcd.c
index 3438fe15c5d..fe7d121ea66 100644
--- a/drivers/lcd/max7219.c
+++ b/drivers/lcd/max7219_lcd.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/lcd/max7219.c
+ * drivers/lcd/max7219_lcd.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *

Reply via email to