Skip to content

Guard LR1121/LR2021 radio configs with #ifdef - #10998

Merged
thebentern merged 2 commits into
meshtastic:developfrom
valzzu:promicro-rfswitch-ifdef
Jul 13, 2026
Merged

Guard LR1121/LR2021 radio configs with #ifdef#10998
thebentern merged 2 commits into
meshtastic:developfrom
valzzu:promicro-rfswitch-ifdef

Conversation

@valzzu

@valzzu valzzu commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Add conditional compilation guards for LR1121 and LR2021 radio chip configurations in rfswitch.h to prevent compilation errors when these radios are not in use. Move USE_LR2021 definition to the radio section in variant.h for consistency with other radio chip definitions.

🤝 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:
    • Promicro DIY

Summary by CodeRabbit

  • New Features

    • Added explicit LR2021 radio module support for the DIY nRF52 Pro Micro TCXO board.
    • Configured LR2021 pin assignments, TCXO settings, interrupt mapping, and RF switch behavior.
  • Bug Fixes

    • Prevented LR1121 and LR2021 hardware settings from being mixed when selecting a radio module.
    • Ensured each module uses only its applicable RF switch configuration.

Add conditional compilation guards for LR1121 and LR2021 radio chip configurations in rfswitch.h to prevent compilation errors when these radios are not in use. Move USE_LR2021 definition to the radio section in variant.h for consistency with other radio chip definitions.
@github-actions

github-actions Bot commented Jul 12, 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 (27)
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 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-11. Updated for e7e482a.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The board variant now enables LR2021 explicitly and conditionally compiles LR2021 configuration macros and LR1121/LR2021 RF switch mappings.

Changes

LR2021 configuration

Layer / File(s) Summary
Enable LR2021 configuration
variants/nrf52840/diy/nrf52_promicro_diy_tcxo/variant.h
Defines USE_LR2021 and guards the LR2021 pin and configuration macros with that selection flag.
Guard RF switch mappings
variants/nrf52840/diy/nrf52_promicro_diy_tcxo/rfswitch.h
Guards the LR1121 and LR2021 RF switch tables independently and includes the LR2021 DIO8 front-end power signal in its documentation.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is concise and accurately summarizes the main change to radio config guards.
Description check ✅ Passed The description includes a clear summary and completed attestations, with at least one device test noted.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@thebentern
thebentern merged commit 5e99139 into meshtastic:develop Jul 13, 2026
95 of 96 checks passed
Itzdavid01 pushed a commit to Itzdavid01/firmware that referenced this pull request Sep 5, 2026
Add conditional compilation guards for LR1121 and LR2021 radio chip configurations in rfswitch.h to prevent compilation errors when these radios are not in use. Move USE_LR2021 definition to the radio section in variant.h for consistency with other radio chip definitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants