Skip to content

Experimental lr1121 generic support#1705

Closed
aslater3 wants to merge 4 commits intomeshcore-dev:mainfrom
aslater3:pr/lr1121-generic-support
Closed

Experimental lr1121 generic support#1705
aslater3 wants to merge 4 commits intomeshcore-dev:mainfrom
aslater3:pr/lr1121-generic-support

Conversation

@aslater3
Copy link
Copy Markdown

Summary

This PR adds LR1121-specific TX power handling for multi-band operation by enforcing different maximum TX power limits based on active RF band.

What Changed

  • Updated CustomLR1121 to track the currently configured band from setFrequency(...).
  • Added LR1121-specific TX power clamping in both setOutputPower(...) overloads:
    • 2.4 GHz band: max 20 dBm
    • sub-GHz band: max 22 dBm
  • Kept changes scoped to CustomLR1121 so non-LR1121 radios and boards are unaffected.

Why

This addresses maintainer feedback that LR1121 needs special handling because it supports multiple radios with different TX power limits by band.

Scope / Compatibility

  • No behavior change for non-LR1121 targets.
  • No board-level logic changes required for existing non-LR1121 variants.

Testing

  • Code-level validation only in this PR.
  • Full hardware/runtime validation should be done on LR1121 targets in both sub-GHz and 2.4 GHz configurations. Tested locally on subGhz in repeater and companion mode.

Copy link
Copy Markdown
Contributor

@weebl2000 weebl2000 left a comment

Choose a reason for hiding this comment

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

needs a bit of love.


#include <RadioLib.h>

class CustomLR1121 : public LR1121 {
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.

How is the radio actually initialized?

return LR1121::setFrequency(freq);
}

int16_t setFrequency(float freq, bool skipCalibration, float band = 4) {
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.

This isn´t actually overriding.

return LR1121::setOutputPower(clampTxPower(power));
}

int16_t setOutputPower(int8_t power, bool forceHighPower, uint32_t rampTimeUs = 48) {
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.

Same

@liamcottle
Copy link
Copy Markdown
Member

Hi there, thanks for the contribution. I'll close this one out since it's experimental, was opened against main instead of dev and the review comments haven't been addressed.

@liamcottle liamcottle closed this Apr 12, 2026
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.

5 participants