mirror of
https://github.com/apache/nuttx.git
synced 2026-08-20 21:18:23 +00:00
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 <ricard@groundbits.com> Assisted-by: Claude Opus 5 (Claude Code)
197 lines
4 KiB
Text
197 lines
4 KiB
Text
############################################################################
|
|
# drivers/lcd/Make.defs
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
# this work for additional information regarding copyright ownership. The
|
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
# "License"); you may not use this file except in compliance with the
|
|
# License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
############################################################################
|
|
|
|
ifeq ($(CONFIG_LCD),y)
|
|
|
|
# Support for the generic LCD framebuffer front-end
|
|
|
|
ifeq ($(CONFIG_LCD_FRAMEBUFFER),y)
|
|
CSRCS += lcd_framebuffer.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_DEV),y)
|
|
CSRCS += lcd_dev.c
|
|
endif
|
|
|
|
# Include support for Graphics LCD drivers
|
|
|
|
ifeq ($(CONFIG_LCD_FT80X),y)
|
|
CSRCS += ft80x.c
|
|
ifeq ($(CONFIG_LCD_FT80X_SPI),y)
|
|
CSRCS += ft80x_spi.c
|
|
else ifeq ($(CONFIG_LCD_FT80X_I2C),y)
|
|
CSRCS += ft80x_i2c.c
|
|
endif
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_LPM013M091A),y)
|
|
CSRCS += lpm013m091a.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_APA102),y)
|
|
CSRCS += apa102_lcd.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_P14201),y)
|
|
CSRCS += p14201.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_UG2864AMBAG01),y)
|
|
CSRCS += ug-2864ambag01.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_UG9664HSWAG01),y)
|
|
CSRCS += ug-9664hswag01.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1306),y)
|
|
CSRCS += ssd1306_base.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1306_SPI),y)
|
|
CSRCS += ssd1306_spi.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1306_I2C),y)
|
|
CSRCS += ssd1306_i2c.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1289),y)
|
|
CSRCS += ssd1289.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1680),y)
|
|
CSRCS += ssd1680.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1351),y)
|
|
CSRCS += ssd1351.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_MIO283QT2),y)
|
|
CSRCS += mio283qt2.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_MAX7219),y)
|
|
CSRCS += max7219_lcd.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_MIO283QT9A),y)
|
|
CSRCS += mio283qt9a.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_PCD8544),y)
|
|
CSRCS += pcd8544.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7565),y)
|
|
CSRCS += st7565.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7567),y)
|
|
CSRCS += st7567.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SHARP_MEMLCD),y)
|
|
CSRCS += memlcd.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ILI9225),y)
|
|
CSRCS += ili9225.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ILI9340),y)
|
|
CSRCS += ili9340.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ILI9341),y)
|
|
CSRCS += ili9341.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_LCDDRV_SPIIF),y)
|
|
CSRCS += lcddrv_spiif.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_RA8875),y)
|
|
CSRCS += ra8875.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7735),y)
|
|
CSRCS += st7735.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7789),y)
|
|
CSRCS += st7789.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7796),y)
|
|
CSRCS += st7796.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_GC9A01),y)
|
|
CSRCS += gc9a01.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_JD9851),y)
|
|
CSRCS += jd9851.c
|
|
endif
|
|
|
|
endif # CONFIG_LCD
|
|
|
|
ifeq ($(CONFIG_SLCD),y)
|
|
|
|
# Include support for Alphanumeric/Segment LCD drivers
|
|
|
|
ifeq ($(CONFIG_LCD_BACKPACK),y)
|
|
CSRCS += pcf8574_lcd_backpack.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7032),y)
|
|
CSRCS += st7032.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_HT16K33),y)
|
|
CSRCS += ht16k33_14seg.c
|
|
endif
|
|
endif # CONFIG_SLCD
|
|
|
|
# Other LCD-related devices
|
|
|
|
ifeq ($(CONFIG_LCD_TDA19988),y)
|
|
CSRCS += tda19988.c
|
|
endif
|
|
|
|
# Include LCD driver build support (the nested if-then-else implements an OR)
|
|
|
|
ifeq ($(CONFIG_LCD),y)
|
|
DEPPATH += --dep-path lcd
|
|
VPATH += :lcd
|
|
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)drivers$(DELIM)lcd
|
|
else ifeq ($(CONFIG_SLCD),y)
|
|
DEPPATH += --dep-path lcd
|
|
VPATH += :lcd
|
|
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)drivers$(DELIM)lcd
|
|
else ifeq ($(CONFIG_LCD_OTHER),y)
|
|
DEPPATH += --dep-path lcd
|
|
VPATH += :lcd
|
|
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)drivers$(DELIM)lcd
|
|
endif
|