Skip to content

boards/xtensa: heltec_wifi_lora_32: Add userleds support#18831

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

boards/xtensa: heltec_wifi_lora_32: Add userleds support#18831
Shriyans406 wants to merge 1 commit into
apache: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
eren-terzioglu
eren-terzioglu 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
jerpelea
jerpelea previously approved these changes May 7, 2026
@xiaoxiang781216
Copy link
Copy Markdown
Contributor

@Shriyans406 still contain ci error:

../nuttx/tools/checkpatch.sh -c -u -m -g  b82b5d0ebc0349d44f7d004b722cbbfd2de9d19d..HEAD
Used config files:
    1: .codespellrc
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/xtensa/esp32/heltec_wifi_lora32/src/heltec_wifi_lora32.h:49:1: error: Too many blank lines
Some checks failed. For contributing guidelines, see:
  https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md
Error: Process completed with exit code 1.

@Shriyans406
Copy link
Copy Markdown
Author

Shriyans406 commented Jun 2, 2026 via email

@linguini1
Copy link
Copy Markdown
Contributor

linguini1 commented Jun 2, 2026

Did you actually test this on the board? Also please fix the PR title that is truncated.

@Shriyans406 Shriyans406 changed the title boards/xtensa/esp32: Add LED support for boards/xtensa: heltec_wifi_lora_32: Add userleds support Jun 5, 2026
@Shriyans406
Copy link
Copy Markdown
Author

Shriyans406 commented Jun 5, 2026 via email

@acassis
Copy link
Copy Markdown
Contributor

acassis commented Jun 5, 2026

Thank you for the review 1. Yes, I have tested this and verified that the LED functions correctly. 2. I have updated the PR title to fix the truncation and accurately reflect the changes. 3. I also fixed the trailing blank lines checkpatch error, and the CI should pass now. Please let me know if there is anything else needed Regards

On Wed, Jun 3, 2026 at 12:49 AM Matteo Golin @.> wrote: linguini1 left a comment (apache/nuttx#18831) <#18831 (comment)> Did you actually test this on the board? Also please fix the PR title that is truncated. — Reply to this email directly, view it on GitHub <#18831?email_source=notifications&email_token=BMTFX7WSEBVOQSBULHTQT2T454SCRA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRQGYZDGMBTGMZKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4606230332>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BMTFX7QZ5U4KJW3UI36HEWL454SCRAVCNFSM6AAAAACYOBZOHWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DMMBWGIZTAMZTGI . Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS https://github.com/notifications/mobile/ios/BMTFX7SIWEV6KB44OFXT3XL454SCRA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRQGYZDGMBTGMZKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y and Android https://github.com/notifications/mobile/android/BMTFX7XAVRBLSL53Z3I26YT454SCRA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRQGYZDGMBTGMZKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI. Download it today! You are receiving this because you were mentioned.Message ID: @.>

@Shriyans406 please fix these issues:

../nuttx/tools/checkpatch.sh -c -u -m -g  b82b5d0ebc0349d44f7d004b722cbbfd2de9d19d..HEAD
❌ Missing git commit message
❌ Missing Signed-off-by
❌ Missing git commit message
❌ Missing git commit message
❌ Missing git commit message
❌ Missing git commit message
❌ Missing Signed-off-by
❌ Missing Signed-off-by
❌ Missing git commit message
Used config files:
    1: .codespellrc
All done! ✨ 🍰 ✨
1 file would be left unchanged.
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:30: Cancelation ==> Cancellation
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:68: cancelability ==> cancellability
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:86: eanbled ==> enabled
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:146: culiminating ==> culminating
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:222: culiminating ==> culminating
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:276: defferred ==> deferred
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:287: propogate ==> propagate
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:379: semphore ==> semaphore
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:382: impelements ==> implements
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:387: interrup ==> interrupt
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/cancellation_points.rst:425: applicaton ==> application
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/file_descriptors.rst:138: decribed ==> described
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/file_descriptors.rst:156: SYLOG ==> SYSLOG
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/kernel_modules_vs_shared_libraries.rst:115: addres ==> address
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/kernel_modules_vs_shared_libraries.rst:150: adress ==> address
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/memory_configurations.rst:33: architecutre ==> architecture
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/memory_configurations.rst:413: environmnet ==> environment
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/memory_configurations.rst:487: aroung ==> around
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/naming_os_internals.rst:14: controvery ==> controversy
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/naming_os_internals.rst:152: accepable ==> acceptable
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/nuttx_initialization_sequence.rst:358: intialization ==> initialization
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/nuttx_initialization_sequence.rst:451: funcions ==> functions
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/nuttx_tasking.rst:176: pre-empted ==> preempted
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/smp.rst:53: implemention ==> implementation
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/smp.rst:192: excuting ==> executing
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/smp.rst:512: pre-empted ==> preempted
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/smp.rst:589: Currnetly ==> Currently
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/smp.rst:836: phtread ==> pthread
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:72: accessable ==> accessible
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:287: SYLOG ==> SYSLOG
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:301: ouput ==> output
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:301: throug ==> through
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:326: SYLOG ==> SYSLOG
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:349: acutally ==> actually
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:398: fromthe ==> from the
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:542: Pre-pend ==> Prepend
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:728: partical ==> partial, particle
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:731: migh ==> might
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:746: diffrent ==> different
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/syslog.rst:790: agressively ==> aggressively
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/tickless_os.rst:90: Cywgin ==> Cygwin
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/tickless_os.rst:157: Intefaces ==> Interfaces
/home/runner/work/nuttx/nuttx/nuttx/Documentation/implementation/tickless_os.rst:262: remainging ==> remaining

@acassis
Copy link
Copy Markdown
Contributor

acassis commented Jun 5, 2026

@Shriyans406 I think many of these issues are happening because you use merge instead of git rebase.
Please update your upstream with mainline and rebase your branch with upstream

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 S Sahoo <shriyans.s.sahoo@gmail.com>
@Shriyans406 Shriyans406 force-pushed the boards/esp32/heltec_leds branch from 6ff1757 to 7ce951f Compare June 5, 2026 16:20
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.

6 participants