nuttx/.github
Ricard Rosson 0735bc16b9 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 <ricard@groundbits.com>
Assisted-by: Claude Opus 5 (Claude Code)
2026-08-13 09:54:26 -03:00
..
actions free disk space action added to fix docker image build issue 2023-12-08 14:42:17 +01:00
ISSUE_TEMPLATE .github/ISSUE_TEMPLATE: Add host_info command section into bug report template 2025-01-21 09:11:17 +08:00
linters .github/linters: Ignore E704 warning 2024-11-17 08:31:08 -03:00
scripts ci: Support pull request dependencies via Depends-On. 2026-08-01 20:26:14 +08:00
workflows build(deps): bump docker/login-action from 4.5.1 to 4.6.0 2026-08-05 12:38:32 +02:00
CODEOWNERS drivers/lcd: rename apa102.c/max7219.c to unique object names 2026-08-13 09:54:26 -03:00
dependabot.yml
gcc.json
labeler.yml CI: fix labeler for common boards files 2026-03-08 17:29:17 +01:00
membrowse-targets.json ci/testing: Update MemBrowse targets and concurrency condition 2026-06-25 12:56:02 -03:00
nxstyle.json
PULL_REQUEST_TEMPLATE.md docs/pr-template: Update the testing section of the PR template 2025-09-08 08:09:57 -03:00
SECURITY.md .github: SECURITY.md update. 2026-07-08 09:52:09 +08:00