examples/apa102: use fprintf() instead of the kernel _err() macro

_err() is a kernel-internal debug macro from <debug.h>; it resolves to
the kernel-only _err symbol, which an application cannot reference.  In a
flat build the example therefore fails to link:

  apa102_main.c: undefined reference to `_err'

(observed on xtensa/esp32s3).  Report the failure with fprintf(stderr),
which is what the open() error path a few lines above already does.

Signed-off-by: Ricard Rosson <ricard@groundbits.com>
Assisted-by: Claude Opus 5 (Claude Code)
This commit is contained in:
Ricard Rosson 2026-08-11 09:02:34 +01:00 committed by Alan C. Assis
parent a76f5bab50
commit 569d8f31db

View file

@ -168,7 +168,7 @@ int main(int argc, FAR char *argv[])
ret = write(fd, ledstrip, 4 * NUM_LEDS);
if (ret < 0)
{
_err("ERROR: write LED Strip failed: %d\n", errno);
fprintf(stderr, "ERROR: write LED Strip failed: %d\n", errno);
}
usleep(US_DELAY);