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-apps.git

commit 569d8f31dbd7934a7e20606db311fcfb1e86b59d
Author: Ricard Rosson <[email protected]>
AuthorDate: Tue Aug 11 09:02:34 2026 +0100

    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 <[email protected]>
    Assisted-by: Claude Opus 5 (Claude Code)
---
 examples/apa102/apa102_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/apa102/apa102_main.c b/examples/apa102/apa102_main.c
index 8e933b392..1e865c941 100644
--- a/examples/apa102/apa102_main.c
+++ b/examples/apa102/apa102_main.c
@@ -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);

Reply via email to