Skip to content

Add LoRa FEM LNA toggle menu support - #11341

Open
Quency-D wants to merge 2 commits into
meshtastic:developfrom
Quency-D:FEM-LNA-Screen-Control
Open

Add LoRa FEM LNA toggle menu support#11341
Quency-D wants to merge 2 commits into
meshtastic:developfrom
Quency-D:FEM-LNA-Screen-Control

Conversation

@Quency-D

@Quency-D Quency-D commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an on-device screen menu for controlling the LoRa FEM LNA using the existing fem_lna_mode configuration.

This restores the screen control that was removed from #9753 without changing the protobuf definition, FEM driver, or default LNA behavior.

Changes

  • Adds FEM LNA to the on-device LoRa Actions menu.
  • Only shows the option when the detected FEM supports software LNA control.
    • Heltec V4.3 with KCT8103L: option is available.
    • Heltec V4.2 and earlier with GC1109: option remains hidden because its LNA cannot be bypassed through software.
    • Boards without a LoRa FEM are unaffected.
  • Provides Enabled and Disabled selections and highlights the current setting.
  • Applies the selected state immediately and saves it through the existing LoRa configuration flow.
  • Does not require a reboot.
  • Keeps the LNA enabled by default.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • Heltec V4.2 / V4.3
    • Heltec wireless tracker V2
    • Heltec mesh node t096

Hardware testing is still required before these attestations can be checked.

Summary by CodeRabbit

  • New Features
    • Added a LoRa FEM LNA menu for compatible hardware.
    • Users can enable or disable FEM LNA operation directly from the LoRa settings.
    • The menu is shown only when supported hardware controls are available.
    • Changes are applied immediately and reflected in the device configuration.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f9d52c44-dcd5-4055-b347-ae3562f3543c

📥 Commits

Reviewing files that changed from the base of the PR and between 41c5c92 and 47f80cc.

📒 Files selected for processing (2)
  • src/graphics/draw/MenuHandler.cpp
  • src/graphics/draw/MenuHandler.h

📝 Walkthrough

Walkthrough

Changes

LoRa FEM LNA menu

Layer / File(s) Summary
Menu contract and FEM entry
src/graphics/draw/MenuHandler.h, src/graphics/draw/MenuHandler.cpp
When HAS_LORA_FEM is enabled and controllable hardware is available, the LoRa menu adds the FEM LNA option and routes selection to the new menu.
FEM LNA toggle handling
src/graphics/draw/MenuHandler.cpp
The new menu supports Back, Enabled, and Disabled. Valid changes update the FEM LNA configuration, apply the hardware state, reload configuration, and log the result.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: nomdetom

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant menuHandler
  participant LoRaFEMInterface
  participant DeviceConfiguration
  participant Logger
  User->>menuHandler: Select FEM LNA mode
  menuHandler->>LoRaFEMInterface: Update and apply LNA state
  menuHandler->>DeviceConfiguration: Reload configuration
  menuHandler->>Logger: Log FEM LNA state
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a LoRa FEM LNA toggle menu.
Description check ✅ Passed The description explains the purpose, behavior, hardware conditions, and implementation scope, but it contains a minor testing-attestation contradiction.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Xaositek Xaositek added the hardware-support Hardware related: new devices or modules, problems specific to hardware label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardware-support Hardware related: new devices or modules, problems specific to hardware

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants