Skip to content

boards/xtensa/esp32: Add LED support for#18831

Open
Shriyans406 wants to merge 1 commit intoapache:masterfrom
Shriyans406:boards/esp32/heltec_leds
Open

boards/xtensa/esp32: Add LED support for#18831
Shriyans406 wants to merge 1 commit intoapache:masterfrom
Shriyans406:boards/esp32/heltec_leds

Conversation

@Shriyans406
Copy link
Copy Markdown

@Shriyans406 Shriyans406 commented May 2, 2026

Summary

Added support for the onboard User LED on the Heltec WiFi LoRa 32 board. This board-specific implementation utilizes the standard NuttX User LED framework (/dev/userleds), mapping the white LED to GPIO 25. Cleaned up a conflicting legacy GPIO_LED1 definition.

Impact

Enables the /dev/userleds character device on the heltec_wifi_lora32 board. No impact on other boards or existing architectures.

Testing

Tested by building the heltec_wifi_lora32 configuration in a Linux environment. Verified the driver registration in esp32_bringup.c and validated the coding style using checkpatch.sh.

@github-actions github-actions Bot added Size: S The size of the change in this PR is small Board: xtensa labels May 2, 2026
@Shriyans406 Shriyans406 force-pushed the boards/esp32/heltec_leds branch from 69d120b to c830627 Compare May 2, 2026 11:43
@github-actions github-actions Bot added Size: M The size of the change in this PR is medium and removed Size: S The size of the change in this PR is small labels May 2, 2026
Copy link
Copy Markdown
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Please fill out the PR template according to the contribution guide, and also run ./tools/checkpatch.sh on your changes to make sure it meets the coding style (that is why CI is failing)

@Shriyans406 Shriyans406 force-pushed the boards/esp32/heltec_leds branch 2 times, most recently from 7a04e7e to 2fbefa9 Compare May 3, 2026 17:50
jerpelea
jerpelea previously approved these changes May 4, 2026
@acassis
Copy link
Copy Markdown
Contributor

acassis commented May 6, 2026

@Shriyans406 please fix these issues in your file:


../nuttx/tools/checkpatch.sh -c -u -m -g  a8a492cb4fe77ed6bc656e33fc2e3c4363b61d33..HEAD
❌ Commit subject must be followed by a blank line
Used config files:
    1: .codespellrc
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:39:46: error: Left bracket not on separate line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:39:58: error: Right bracket not on separate line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:39:1: error: Blank line precedes right brace at line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:48:40: error: Left bracket not on separate line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:49:40: error: Left bracket not on separate line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:51:2: error: Bad right brace alignment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:51:3: error: Right brace must be followed by a blank line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:53:1: error: Right brace must be followed by a blank line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:58:1: error: Too many blank lines
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:59:40: error: Left bracket not on separate line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:60:35: error: Left bracket not on separate line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:62:2: error: Bad right brace alignment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:63:1: error: Right brace must be followed by a blank line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:68:40: error: Left bracket not on separate line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:69:40: error: Left bracket not on separate line
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:71:2: error: Bad right brace alignment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c:72:0: error: Garbage follows right bracket

@linguini1
Copy link
Copy Markdown
Contributor

Tested by building the heltec_wifi_lora32 configuration in a Linux environment. Verified the driver registration in esp32_bringup.c and validated the coding style using checkpatch.sh.

Do you have like a photo of the LED working on your board? Or how did you verify registration?

Comment thread boards/xtensa/esp32/heltec_wifi_lora32/src/heltec_wifi_lora32.h Outdated
Heltec WiFi LoRa 32 board

This commit adds the User LED driver support for the Heltec WiFi LoRa 32
board. It implements the lower-half driver, maps the onboard white LED
to GPIO 25, and adds the necessary build system and initialization logic.

Signed-off-by: Shriyans Sahoo <shriyans.s.sahoo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Board: xtensa Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants