Skip to content

Enable lr2021 on native - #10567

Closed
jessm33 wants to merge 22 commits into
meshtastic:developfrom
jessm33:Enable-lr2021-on-native
Closed

Enable lr2021 on native#10567
jessm33 wants to merge 22 commits into
meshtastic:developfrom
jessm33:Enable-lr2021-on-native

Conversation

@jessm33

@jessm33 jessm33 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Changes to enable lr2021 LoRA radio support on native platform, including a few new config options for the lr2021, sample config files for ch341 are provided.

🤝 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
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)
      • nrf52-promicro
      • Linux naive

Summary by CodeRabbit

Summary

  • New Features

    • Added a LoRa USB device profile for LR2021 (USB + community support).
    • Added a use_lr2021 Portduino module option to auto-select the LR2021 interface.
  • Bug Fixes

    • Improved RF switch configuration, including correct MODE_RX_HF (“HIGH”) handling.
    • Enhanced Portduino LR2021 parsing for max power (HF) and IRQ DIO, plus IRQ DIO selection improvements.
  • Refactor

    • Standardized LR2021/LR20x0 build guards and clarified RF switch symbol handling for better variant compatibility.
    • Updated RF switch header guards for reliability.

@github-actions github-actions Bot added needs-review Needs human review hardware-support Hardware related: new devices or modules, problems specific to hardware labels May 28, 2026
Comment thread bin/config.d/lora-lyra-ultra-LoRa2021F33.yaml Outdated
@jessm33
jessm33 marked this pull request as ready for review June 23, 2026 19:18
@thebentern
thebentern requested a review from Copilot July 1, 2026 01:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Enables LR2021 LoRA radio support on the native (Portduino) platform by adding module selection/configuration and wiring up LR2021 initialization and RF-switch handling.

Changes:

  • Added lr2021 as a selectable LoRA module for Portduino and introduced LR2021-specific config options (max power incl. HF and IRQ DIO number).
  • Updated radio initialization to construct LR2021Interface when selected.
  • Refactored RF-switch symbol handling to avoid LR11x0/LR20x0 table name collisions and added a sample native USB config for an LR2021 module.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
variants/nrf52840/diy/nrf52_promicro_diy_tcxo/rfswitch.h Adds LR20x0-native RF-switch definitions and wraps existing tables with per-table guards.
src/platform/portduino/PortduinoGlue.h Adds use_lr2021 and LR2021-related config fields.
src/platform/portduino/PortduinoGlue.cpp Loads new LR2021 config values from YAML.
src/mesh/RadioInterface.cpp Constructs an LR2021Interface when use_lr2021 is selected.
src/mesh/LR20x0Interface.cpp Adjusts compile guards, RF-switch aliasing, and Portduino IRQ DIO configuration.
src/mesh/LR2021Interface.cpp Adjusts compile guard for LR2021 interface compilation.
src/mesh/LR11x0Interface.cpp Namespaces LR11x0 RF-switch tables to avoid collisions and updates usage.
src/mesh/InterfacesTemplates.cpp Adjusts explicit template instantiation guard for LR20x0/LR2021.
bin/config.d/lora-usb-meshtoad-nicerflora2021f33.yaml Adds a sample native USB configuration for an LR2021-based module.

Comment on lines 1 to 3
#include "RadioLib.h"

// Keep LR20x0 naming while RadioLib exposes LR2021 symbols.
Comment on lines 49 to 50
static const uint32_t lr20x0_rfswitch_dio_pins[] = {RADIOLIB_LR2021_DIO5, RADIOLIB_LR2021_DIO6, RADIOLIB_LR2021_DIO7,
RADIOLIB_LR2021_DIO8, RADIOLIB_NC};
Comment on lines +28 to 30
#if RADIOLIB_EXCLUDE_LR2021 != 1
template class LR20x0Interface<LR2021>;
#endif
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Flash this PR in the Web Flasher

firmware commit boards expires

Warning

This is an automated, unreviewed CI test build. Back up your device configuration
before flashing, and only flash devices you are able to recover.

Supported boards built by this PR (30)
Device Board Platform
Crowpanel Adv 3.5 TFT elecrow-adv-35-tft esp32-s3
Heltec HT62 heltec-ht62-esp32c3-sx1262 esp32-c3
Heltec Mesh Node 096 heltec-mesh-node-t096 nrf52840
Heltec Mesh Node T1 heltec-mesh-node-t1 nrf52840
Heltec Mesh Node T114 heltec-mesh-node-t114 nrf52840
Heltec V3 heltec-v3 esp32-s3
Heltec V4 heltec-v4 esp32-s3
Meshnology W10 meshnology_w10 esp32-s3
Raspberry Pi Pico pico rp2040
Raspberry Pi Pico W picow rp2040
RAK WisMesh Pocket V3 rak_wismesh_pocket nrf52840
RAK WisMesh Pod rak_wismesh_pod nrf52840
RAK WisMesh Repeater Mini V2 rak_wismesh_repeater_mini nrf52840
RAK WisMesh Tag rak_wismeshtag nrf52840
RAK WisBlock 11200 rak11200 esp32
RAK WisBlock 11310 rak11310 rp2040
RAK3312 rak3312 esp32-s3
RAK WisBlock 4631 rak4631 nrf52840
Seeed SenseCAP Mesh-Tracker-X1 seeed_mesh_tracker_X1 nrf52840
Seeed Wio Tracker L1 seeed_wio_tracker_L1 nrf52840
Seeed Xiao NRF52840 Kit seeed_xiao_nrf52840_kit nrf52840
Seeed Xiao ESP32-S3 seeed-xiao-s3 esp32-s3
Station G2 station-g2 esp32-s3
Station G3 station-g3 esp32-s3
LILYGO T-Deck t-deck-tft esp32-s3
LILYGO T-Echo t-echo nrf52840
LILYGO T-Echo Plus t-echo-plus nrf52840
LILYGO T-Impulse Plus t-impulse-plus nrf52840
LilyGo T3-C6 tlora-c6 esp32-c6
Seeed SenseCAP T1000-E tracker-t1000-e nrf52840

Build artifacts expire on 2026-08-19. Updated for ef490be.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Firmware Size Report

22 targets | vs develop: 22 decreased, net -177,316 (-173.2 KB)

Target Size vs develop
heltec-vision-master-e213-inkhud 2,216,080 📉 -11,280 (-11.0 KB)
heltec-v4 2,267,552 📉 -9,744 (-9.5 KB)
t-eth-elite 2,481,808 📉 -9,680 (-9.5 KB)
elecrow-adv-35-tft 3,407,040 📉 -9,584 (-9.4 KB)
heltec-v3 2,255,152 📉 -8,928 (-8.7 KB)
Show 17 more target(s)
Target Size vs develop
heltec-ht62-esp32c3-sx1262 2,126,112 📉 -8,880 (-8.7 KB)
tlora-c6 2,359,488 📉 -8,816 (-8.6 KB)
rak11200 1,851,920 📉 -8,688 (-8.5 KB)
seeed-xiao-s3 2,267,664 📉 -8,480 (-8.3 KB)
rak3312 2,263,824 📉 -8,416 (-8.2 KB)
station-g2 2,258,016 📉 -8,336 (-8.1 KB)
station-g3 2,258,016 📉 -8,336 (-8.1 KB)
picow 1,236,896 📉 -7,984 (-7.8 KB)
t-deck-tft 3,803,072 📉 -7,600 (-7.4 KB)
pico2w 1,212,956 📉 -7,560 (-7.4 KB)
pico 775,168 📉 -7,520 (-7.3 KB)
seeed_xiao_rp2040 773,384 📉 -7,520 (-7.3 KB)
rak11310 798,088 📉 -7,336 (-7.2 KB)
seeed_xiao_rp2350 760,840 📉 -7,096 (-6.9 KB)
pico2 762,696 📉 -7,080 (-6.9 KB)
wio-e5 234,364 📉 -4,264 (-4.2 KB)
rak3172 182,108 📉 -4,188 (-4.1 KB)

Updated for 18ae0c2

@thebentern

Copy link
Copy Markdown
Contributor

@jessm33 can you run trunk fmt?

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds LR2021 Portduino support, updates LR11x0/LR20x0 RF switch handling and compilation guards, extends Portduino configuration and radio selection, and adds a meshtoad2021 device profile.

Changes

LR2021 Portduino Integration and RF Switch Renaming

Layer / File(s) Summary
Enable LR2021 compilation
src/mesh/InterfacesTemplates.cpp, src/mesh/LR2021Interface.cpp, src/mesh/LR20x0Interface.cpp
Compilation no longer requires USE_LR2021 when LR2021 is not excluded.
Scope RF switch configuration
src/mesh/LR11x0Interface.cpp, src/mesh/LR20x0Interface.cpp, variants/nrf52840/diy/nrf52_promicro_diy_tcxo/rfswitch.h
RF switch symbols are scoped by radio family, with native LR20x0 definitions and explicit variant-header guards.
Wire Portduino LR2021 support
src/platform/portduino/PortduinoGlue.h, src/platform/portduino/PortduinoGlue.cpp, src/mesh/LR20x0Interface.cpp, src/mesh/RadioInterface.cpp
Portduino adds LR2021 selection and settings, parses new YAML values, handles HF RF switch mode, selects the configured IRQ DIO, and constructs LR2021Interface.
Define meshtoad2021 device profile
bin/config.d/lora-usb-meshtoad-nicerflora2021f33.yaml
A YAML profile defines LR2021 pins, USB identifiers, SPI selection, and NiceRF LoRa2021F33 RF switch modes.

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

Sequence Diagram(s)

sequenceDiagram
  participant PortduinoGlue
  participant portduino_config
  participant RadioInterface
  participant LR2021Interface
  PortduinoGlue->>portduino_config: parse LR2021 power, IRQ, and RX HF settings
  RadioInterface->>portduino_config: select use_lr2021
  RadioInterface->>LR2021Interface: construct interface
  LR2021Interface->>portduino_config: read lr2021_irq_dio_num
  LR2021Interface->>LR2021Interface: set lora.irqDioNum during init
Loading

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: jp-bennett, caveman99

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and clearly matches the main change: enabling LR2021 support on native builds.
Description check ✅ Passed The description follows the template’s main sections and includes a change summary plus attestations/testing notes.
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bin/config.d/lora-usb-meshtoad-nicerflora2021f33.yaml`:
- Around line 24-31: The rfswitch_table entry includes MODE_RX_HF, but
PortduinoGlue.cpp only parses the supported mode keys, so this column will be
ignored at runtime. Update the LoRa2021F33 rfswitch_table in the YAML to use one
of the parsed mode names (for example an existing RX/TX variant), or, if LR2021
truly needs it, extend the PortduinoGlue parser first so it recognizes
MODE_RX_HF alongside the other mode constants.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 96ff0d91-46ba-4f2a-bb6a-0c1dcd73e6ac

📥 Commits

Reviewing files that changed from the base of the PR and between e64d205 and d41d055.

📒 Files selected for processing (9)
  • bin/config.d/lora-usb-meshtoad-nicerflora2021f33.yaml
  • src/mesh/InterfacesTemplates.cpp
  • src/mesh/LR11x0Interface.cpp
  • src/mesh/LR2021Interface.cpp
  • src/mesh/LR20x0Interface.cpp
  • src/mesh/RadioInterface.cpp
  • src/platform/portduino/PortduinoGlue.cpp
  • src/platform/portduino/PortduinoGlue.h
  • variants/nrf52840/diy/nrf52_promicro_diy_tcxo/rfswitch.h

Comment thread bin/config.d/lora-usb-meshtoad-nicerflora2021f33.yaml
@jessm33

jessm33 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@jessm33 can you run trunk fmt?

done

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/platform/portduino/PortduinoGlue.cpp (1)

902-937: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Separate LR2021 MODE_RX_HF from the shared MODE_TX_HP slot. src/platform/portduino/PortduinoGlue.cpp stores both YAML keys in rfswitch_table[3], and src/platform/portduino/PortduinoGlue.h only round-trips MODE_TX_HP, so LR2021 configs lose the RX_HF state and the table is tagged with the wrong mode for src/mesh/LR20x0Interface.cpp. Use the LR2021 mode enum for that row instead of aliasing it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/portduino/PortduinoGlue.cpp` around lines 902 - 937, The LR2021
RF switch handling is conflating `MODE_RX_HF` with the `MODE_TX_HP` table entry
in `PortduinoGlue.cpp`, so the YAML state is stored under the wrong mode and
cannot round-trip correctly. Update the `rfswitch_table` setup to use the proper
LR2021 mode symbol for the RX_HF row, and make sure the corresponding
serialization logic in `PortduinoGlue.h` preserves that distinct mode instead of
aliasing it to `MODE_TX_HP`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/platform/portduino/PortduinoGlue.cpp`:
- Around line 902-937: The LR2021 RF switch handling is conflating `MODE_RX_HF`
with the `MODE_TX_HP` table entry in `PortduinoGlue.cpp`, so the YAML state is
stored under the wrong mode and cannot round-trip correctly. Update the
`rfswitch_table` setup to use the proper LR2021 mode symbol for the RX_HF row,
and make sure the corresponding serialization logic in `PortduinoGlue.h`
preserves that distinct mode instead of aliasing it to `MODE_TX_HP`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 97e9d065-a9b5-4ad6-b0ef-a64e5b934433

📥 Commits

Reviewing files that changed from the base of the PR and between fac2969 and ead1ba4.

📒 Files selected for processing (1)
  • src/platform/portduino/PortduinoGlue.cpp

a-li3n added a commit to a-li3n/firmware that referenced this pull request Jul 22, 2026
The save path in PortduinoGlue.h hardcoded LR11x0 mode names
(MODE_TX_HP, MODE_GNSS, MODE_WIFI) and always wrote 7 entries.
For LR2021 configs, slot 3 is MODE_RX_HF (not MODE_TX_HP) and
modes 5-6 (GNSS/WIFI) don't exist. Saving an LR2021 config and
reloading it would put RF switch values in the wrong slots.

Branch the serialization loop on lora_module == use_lr2021:
- Write MODE_RX_HF for slot 3 instead of MODE_TX_HP
- Write only 5 entries (no MODE_GNSS/MODE_WIFI)
- Guard with #if !RADIOLIB_EXCLUDE_LR2021 for builds without LR2021

This matches the load path in PortduinoGlue.cpp which already
branches on use_lr2021 to use LR2021::MODE_* enums.

Ref: CodeRabbit review on meshtastic#10567 (outside-diff
comment on PortduinoGlue.cpp lines 902-937).
a-li3n added a commit to a-li3n/firmware that referenced this pull request Jul 22, 2026
Add full LR2021 radio support for meshtasticd on Linux native builds,
including USB (CH341) and SPI (GPIO) configurations.

Key changes:

PortduinoGlue (config plumbing):
- Add use_lr2021 to lora_module_enum and loraModules map
- Add lr2021_max_power, lr2021_max_power_hf, lr2021_irq_dio_num config fields
- Parse LR2021_MAX_POWER, LR2021_MAX_POWER_HF, IRQ_DIO_NUM (and
  LR2021_IRQ_DIO_NUM alias) from YAML
- Use LR2021::MODE_* enums for rfswitch_table when module is lr2021
  (LR2021 has MODE_RX_HF at value 4 where LR11x0 has MODE_TX_HP;
  no MODE_GNSS/MODE_WIFI)
- Parse MODE_RX_HF YAML key for LR2021 configs instead of MODE_TX_HP
- Branch YAML serialization on use_lr2021 so configs round-trip correctly

LR20x0Interface (radio driver):
- Set irqDioNum BEFORE lora.begin() so config() programs the correct
  DIO for IRQ routing. Setting it after begin() is too late - config()
  has already configured DIO5 as IRQ, then setRfSwitchTable() overrides
  it to RF_SWITCH, breaking all radio interrupts.
  This is the fix for the DIO5 IRQ/RF-switch conflict that caused
  meshtasticd to crash (SIGABRT/segfault) on TX when DIO5 is used for
  both IRQ and RF switch control.
- Add ARCH_PORTDUINO path for reading irqDioNum from config
- Add LR20X0_RFSWITCH_NATIVE guard for variant-defined RF switch tables

LR11x0Interface (symbol namespacing):
- Namespace RF switch symbols as lr11x0_rfswitch_* to prevent collisions
  when LR11x0 and LR20x0 templates share a translation unit
  (InterfacesTemplates.cpp). Removes the old #undef hack.

RadioInterface:
- Add case use_lr2021 to construct LR2021Interface in portduino mode
- Guard hardcoded SPI pin fallback with !defined(ARCH_PORTDUINO)

ProMicro rfswitch.h:
- Add per-table include guards (RFSWITCH_NRF52TCXO_LR11X0_DEFINED,
  RFSWITCH_NRF52TCXO_LR20X0_DEFINED) to prevent redefinition
- Nest #ifdef USE_LR1121 / #ifdef USE_LR2021 inside include guards
  so tables are only emitted when their radio is built
- Add LR20X0_RFSWITCH_NATIVE define so LR20x0Interface uses the
  variant's native lr20x0_rfswitch_* symbols
- Add explanatory comment for DIO7 (in pin array for matrix completeness,
  never driven HIGH on this variant)

Native build config:
- Add -D USE_LR2021 to portduino.ini build flags

Sample configs:
- lora-femtofox_LR2021_TCXO.yaml: SPI/GPIO config for Luckfox Pico Mini
  with GNiceRF LoRa2021F33-2G4 module (DIO3 TCXO, DIO5-8 RF switch,
  IRQ_DIO_NUM: 9 to avoid DIO5 conflict)
- lora-usb-meshtoad-nicerflora2021f33.yaml: USB/CH341 config for
  NiceRF LoRa2021F33 module

Co-authored-by: jessm33 <112707725+jessm33@users.noreply.github.com>

Ref: meshtastic#10567 (portions of LR11x0 symbol namespacing,
ProMicro rfswitch.h guards, and USB config YAML adapted from this PR)
@jessm33 jessm33 closed this Jul 22, 2026
@jessm33 jessm33 reopened this Jul 24, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Jul 27, 2026
8 tasks

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/platform/portduino/PortduinoGlue.cpp (2)

1005-1006: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Register MODE_RX_HF as an RX_HF table entry.

Slot 3 is initialized at Line 976 as LR11x0::MODE_TX_HP, but these lines write MODE_RX_HF values into that slot. Consequently, LR20x0/ LR2021 will not have a table entry matching MODE_RX_HF; initialize the table with the LR20x0 mode (LR20x0::MODE_RX_HF) for that radio family instead of reusing the LR11x0 TX_HP slot.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/portduino/PortduinoGlue.cpp` around lines 1005 - 1006, Update
the rfswitch table initialization near slot 3 so the LR20x0/LR2021 radio family
registers that slot with LR20x0::MODE_RX_HF rather than LR11x0::MODE_TX_HP,
while preserving the existing MODE_RX_HF value assignments.

902-909: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use a safe LR2021 HF-power default and enforce the hardware limit.

lr2021_max_power_hf defaults to 22, but LR20x0Interface applies this value directly for the LORA_24 region, whose documented hardware maximum is 12 dBm. If the YAML omits LR2021_MAX_POWER_HF, the radio can be configured above its safe limit. Default this field to 12 and reject or clamp larger configured values.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/portduino/PortduinoGlue.cpp` around lines 902 - 909, The LR2021
HF power configuration in PortduinoGlue must default to the hardware-safe 12 dBm
limit and prevent YAML values above that limit. Update the LR2021_MAX_POWER_HF
assignment in the configuration-loading code to use 12 as its fallback and
reject or clamp larger configured values before storing them in
portduino_config.lr2021_max_power_hf.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/platform/portduino/PortduinoGlue.cpp`:
- Around line 1005-1006: Update the rfswitch table initialization near slot 3 so
the LR20x0/LR2021 radio family registers that slot with LR20x0::MODE_RX_HF
rather than LR11x0::MODE_TX_HP, while preserving the existing MODE_RX_HF value
assignments.
- Around line 902-909: The LR2021 HF power configuration in PortduinoGlue must
default to the hardware-safe 12 dBm limit and prevent YAML values above that
limit. Update the LR2021_MAX_POWER_HF assignment in the configuration-loading
code to use 12 as its fallback and reject or clamp larger configured values
before storing them in portduino_config.lr2021_max_power_hf.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9d289ac8-21a9-418b-9fec-26682759c5f8

📥 Commits

Reviewing files that changed from the base of the PR and between ef490be and 7f8c194.

📒 Files selected for processing (1)
  • src/platform/portduino/PortduinoGlue.cpp

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 needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants