Skip to content

Add domain info to Lua Version string - #3556

Merged
mha1 merged 7 commits into
ExpressLRS:masterfrom
mha1:domain_info
Mar 2, 2026
Merged

mha1 merged 7 commits into
ExpressLRS:masterfrom
mha1:domain_info

Conversation

@mha1

@mha1 mha1 commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

This adds regulatory domain info to the Lua Version string for both RX and TX devices.

BetaFPV SuperP 14ch 2.4G, SX1280, CE_LBT:
image

BetaFPV SuperP 14ch 900M, SX127x, FCC915:
image

BayckRC 100mW Gemini , LR1121, Dual Band, FCC915M & ISM2.4G:
image

BayckRC 100mW Gemini, LR1121, Dual Band, EU868M & 2.4G CE_LBT:
image

RM XR2, LR1121, Single Band, ISM2.4G:
image

@pkendall64

Copy link
Copy Markdown
Collaborator

How does this look on B&W radios?

@mha1

mha1 commented Feb 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Ok for single band radios.

image

Not so great on dual band radios. We're wasting 5 or 6 characters for the commit. Would be ok if we do the commit right aligned.

image

Comment thread src/lib/FHSS/FHSS.cpp Outdated
}

bool isDomain868()
void setupDomainInfo(char *version_domain, uint8_t len)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • Include a comment about what the expected output of this function is for the various options it can setup
  • len is actually maxlen
  • Is your whitespace in this function 2 spaces, 4 spaces or 6 spaces? (it should be 4) :-D

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • comment: done
  • len changed to maxlen
  • n withespaces image

Comment thread src/lib/FHSS/FHSS.h Outdated
void FHSSrandomiseFHSSsequence(uint32_t seed);
void FHSSrandomiseFHSSsequenceBuild(uint32_t seed, uint32_t freqCount, uint_fast8_t sync_channel, uint8_t *sequence);

// setup domain info for Lua

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't count as the comment "setup domain info" could mean so many things, but put it where the function body is

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread src/lib/rx-crsf/RXParameters.cpp Outdated
#endif
static char modelString[] = "000";
static char pwmModes[] = "50Hz;60Hz;100Hz;160Hz;333Hz;400Hz;10kHzDuty;On/Off;DShot;DShot 3D;Serial RX;Serial TX;I2C SCL;I2C SDA;Serial2 RX;Serial2 TX";
static char version_domain[20+1+6+1];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Include information as to what each of these numbers is there for instead of just being a pile of magic

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have no idea where this came from. lib\tx-crsf\TXModuleParameters.cpp had this already defined without explanation. Maybe you know more. Anyhow, 26 characters is the max. that Lua can display without being overwritten by the commit info on color lcd radios.

image

I changed it to a plain 27 characters (26+'\0')

Comment thread src/lib/FHSS/FHSS.cpp Outdated
return;
}

return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

extra return

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

obsolete

Comment thread src/lib/FHSS/FHSS.cpp Resolved
Comment thread src/lib/FHSS/FHSS.cpp Resolved
Comment thread src/lib/FHSS/FHSS.cpp Outdated
strlcat(version_domain, FHSSconfigDualBand->domain, maxlen); // 2.4GHz
#else
strlcat(version_domain, FHSSconfig->domain, len);
strlcat(version_domain, FHSSconfig->domain, maxlen);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is the same as the first case in the #ifdef, so I think you can just remove the #ifdef completely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That works too. The #ifdef would've save a few bytes flash in case of SX1280/SX127x.

done

@pkendall64 pkendall64 added enhancement 🪄 New feature or request V4.1 🍑 labels Mar 1, 2026

@CapnBry CapnBry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Heck yeah, love it! Thanks

@mha1
mha1 merged commit 65eb2e6 into ExpressLRS:master Mar 2, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 🪄 New feature or request V4.1 🍑

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants