add LR 2021 to portduino, and allow Framebuffer devices to rotate the screen from config - #11252
Conversation
⚡ Try this PR in the Web FlasherWarning This is an automated, unreviewed CI test build. Back up your device configuration Supported boards built by this PR (31)
Build artifacts expire on 2026-08-29. Updated for |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughPortduino now supports LR2021 module selection, configuration, power limits, and compilation. The framebuffer display path exports configured rotation through ChangesPortduino LR2021 enablement
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant PortduinoConfig
participant RadioInterface
participant LR2021Interface
PortduinoConfig->>RadioInterface: select use_lr2021
RadioInterface->>LR2021Interface: construct LR2021Interface
LR2021Interface-->>RadioInterface: provide interface
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/platform/portduino/PortduinoGlue.h (1)
105-106: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse camelCase for the new member variables.
Rename
lr2021_max_powerandlr2021_max_power_hftolr2021MaxPowerandlr2021MaxPowerHf, updating their parser, emitter, and macro references accordingly.As per coding guidelines, use PascalCase for classes, camelCase for functions and member variables, and UPPER_SNAKE_CASE for constants and defines.
🤖 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.h` around lines 105 - 106, Rename the member variables lr2021_max_power and lr2021_max_power_hf to lr2021MaxPower and lr2021MaxPowerHf, and update every parser, emitter, and macro reference to use the new names consistently.Source: Coding guidelines
🤖 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 `@src/mesh/LR11x0Interface.cpp`:
- Around line 381-385: Correct the cleanup comment above the `#undef` directives
to reference the actual member path portduino_config.rfswitch_dio_pins, removing
the duplicated portduino_config qualifier while leaving the macro cleanup
unchanged.
---
Nitpick comments:
In `@src/platform/portduino/PortduinoGlue.h`:
- Around line 105-106: Rename the member variables lr2021_max_power and
lr2021_max_power_hf to lr2021MaxPower and lr2021MaxPowerHf, and update every
parser, emitter, and macro reference to use the new names consistently.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d6c95ece-98fc-4919-b359-b4c0208ab207
📒 Files selected for processing (8)
src/graphics/tftSetup.cppsrc/mesh/InterfacesTemplates.cppsrc/mesh/LR11x0Interface.cppsrc/mesh/LR2021Interface.cppsrc/mesh/LR20x0Interface.cppsrc/mesh/RadioInterface.cppsrc/platform/portduino/PortduinoGlue.cppsrc/platform/portduino/PortduinoGlue.h
vidplace7
left a comment
There was a problem hiding this comment.
Currently breaks the native-wasm target at link-time.
Linking .pio/build/native-wasm/meshnode.mjs
wasm-ld: error: .pio/build/native-wasm/src/mesh/RadioInterface.cpp.o: undefined symbol: LR2021Interface::LR2021Interface(LockingArduinoHal*, unsigned int, unsigned int, unsigned int, unsigned int)
em++: error: '/home/runner/work/firmware/firmware/emsdk-cache/emsdk-main/upstream/bin/wasm-ld @/tmp/emscripten_w_bs6_zi.rsp.utf-8' failed (returned 1)
There was a problem hiding this comment.
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 `@src/graphics/tftSetup.cpp`:
- Around line 65-68: Check the return value of setenv in the rotation setup
block and call LOG_ERROR when updating MESHTASTIC_FB_ROTATION fails. Preserve
the existing rotation value formatting and environment-variable behavior on
success.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2f1722ef-f2fb-41f4-ba43-93c541ac5206
📒 Files selected for processing (9)
src/graphics/tftSetup.cppsrc/mesh/InterfacesTemplates.cppsrc/mesh/LR11x0Interface.cppsrc/mesh/LR2021Interface.cppsrc/mesh/LR20x0Interface.cppsrc/mesh/RadioInterface.cppsrc/platform/portduino/PortduinoGlue.cppsrc/platform/portduino/PortduinoGlue.hvariants/native/portduino/platformio.ini
🚧 Files skipped from review as they are similar to previous changes (7)
- src/mesh/RadioInterface.cpp
- src/mesh/InterfacesTemplates.cpp
- src/mesh/LR11x0Interface.cpp
- variants/native/portduino/platformio.ini
- src/platform/portduino/PortduinoGlue.h
- src/platform/portduino/PortduinoGlue.cpp
- src/mesh/LR20x0Interface.cpp
… screen from config. Requires meshtastic/device-ui#355 and supersedes #10567 and #11138 Many thanks to the original authors https://github.com/a-li3n and https://github.com/jessm33
initLoRa() constructs LR2021Interface for Lora.Module: lr2021, so excluding the file from the native-wasm source filter left the constructor undefined at link time. LR20x0Interface.cpp stays excluded; it is template-only and comes in via the InterfacesTemplates.cpp amalgamation. Also replace the non-UTF-8 degree signs in the framebuffer rotation comment and correct the rfswitch alias cleanup comment.
Requires meshtastic/device-ui#355 and supersedes #10567 and #11138
Many thanks to the original authors https://github.com/a-li3n and https://github.com/jessm33
N.B. This PR enables meshtasticd with framebuffer MUI on Lilygo T-Display K230
Summary by CodeRabbit