Skip to content

Remove isElrs distinction from CRSF parameter read/write - #3680

Merged
CapnBry merged 5 commits into
ExpressLRS:masterfrom
CapnBry:lua-bad-good
Jul 3, 2026
Merged

CapnBry merged 5 commits into
ExpressLRS:masterfrom
CapnBry:lua-bad-good

Conversation

@CapnBry

@CapnBry CapnBry commented Jun 26, 2026 •

Copy link
Copy Markdown
Member

Removes the special CRSF_ADDRESS_ELRS_LUA from our code, and the always-hidden-for-ELRS "Bad/Good" parameter listed in the lua.

Details

The lua uses the made-up address CRSF_ADDRESS_ELRS_LUA to indicate that our own lua is sending the request for PARAMETER_INFO, and thus lets the TX module that very complex special handling should be done.

What special handling? To use a non-standard CRSF flag to override the HIDDEN flag of the "Bad/Good" parameter to be always hidden in our Lua, and therefore shown in the standard TBS lua.

Removing this field means we can remove the non-standard address, all the code associated with tracking this non-standard flag, the code for updating the string nobody sees, and the lua list will load 1/30th faster!

Regressions

  • Users who only use TBS-standard lua scripts will no longer see the "Bad/Good" field in the parameter list. If they want to know this, they'll have to use our own lua which has a separate mechanism for querying this value.
  • Users who update their lua using the version from this PR, but not the TX module firmware built on this PR will now see a new Bad/Good parameter that will not update in their list. The counts on the header still update, but this static value will be there. To clarify:
    • Newest lua running against older (pre-4.1.0) firmware: Will see "bad/good" in list
    • Older lua running against any firmware (2.x.x or 3.x.x or 4.0.x or 4.1.x): No difference from previous behavior

What to Test

There is no visible difference when using the r17 lua or this one (r18) when a module is flashed with this PR. The only difference is in the TBS lua, which will show a bad/good normally but will not on this PR. Our lua should be the only thing that ever used this value, so any other lua script that tunnels through ExpressLRS should still work fine (I tested bf.lua and rotorflight). I do not think there is any need to be to thorough with testing other lua utilities.

So for testing I guess just test that our existing lua (<r18) still loads and works against this PR, EdgeTX still displays the module name in its "About" modules page. You can also verify that when running the r18 lua against any order code (4.0 or 3.x or 2.x) that you now see a bad/good parameter, but I don't think that's worth testing since it is a known result.

@CapnBry CapnBry added house keeping 🧹 Cleanup of code and house keeping V4.1 🍑 labels Jun 26, 2026
CapnBry added 2 commits June 26, 2026 13:31
Did you even test an RX, Bry? Of course I did(n't)
Comment thread src/lua/elrs.lua Outdated
fields_count = device.fldcnt
deviceIsELRS_TX = device.isElrs and devId == 0xEE or nil -- ELRS and ID is TX module
handsetId = deviceIsELRS_TX and 0xEF or 0xEA -- Address ELRS_LUA vs RADIO_TRANSMITTER
-- handsetId = deviceIsELRS_TX and 0xEF or 0xEA -- Address ELRS_LUA vs RADIO_TRANSMITTER for pre 4.1.0 TX firmwares

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.

Why commented out rather than removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I thought maybe for posterity but you're right, this repo preserves how it used to be so no need to keep the old code commented out.

@mha1 mha1 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.

V4.01: as expected r18 shows static bad/good, r17 doesn't. Both versions work with no obvious issues.

PR: as expected r17 and r18 don't show bad/good. Both versionswork with no obvious issues.

@CapnBry
CapnBry merged commit 62a5ce1 into ExpressLRS:master Jul 3, 2026
26 checks passed
ajjjjjjjj added a commit to OpenI6X/opentx that referenced this pull request Jul 4, 2026
ajjjjjjjj added a commit to OpenI6X/opentx that referenced this pull request Aug 8, 2026
Refactored elrs config + smaller compiled size
Always use standard radio address (ExpressLRS/ExpressLRS/pull/3680)
Simplified fieldIntegerDisplay,
Removed unitLoad because it was a copy of paramInfoLoad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

house keeping 🧹 Cleanup of code and house keeping V4.1 🍑

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants