feat(radio): optional key lock feature (2.12 backport) - #7561
Draft
pfeerick wants to merge 7 commits into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
pfeerick
force-pushed
the
pfeerick/keys-lock-2.12
branch
2 times, most recently
from
July 23, 2026 06:52
0c749c5 to
089b430
Compare
Ports the equivalent combo assignments from PR 7383 (main branch) so these targets get the key-lock feature: c14/v14/v14lcd use SYS+MODEL, t22 uses PAGEDN+ENTER, st16 uses EXIT+ENTER. V12 is left without a combo since it lacks a KEY_MENU to safely fall back to. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ncation, and struct dedup - yaml_datastructs_c14.cpp and yaml_datastructs_v12.cpp were missing the keyLockEnabled mapping entirely, so the setting silently failed to persist across save/load on those radios. - The B&W 128x64/212x64 key-lock menu label buffer (lbl[24]) was too small for STR_KEY_LOCK_FMT's worst-case output (up to 28 bytes for combos like PAGE<+PAGE>), causing truncation. Bumped to lbl[45], matching the ColorLCD equivalent. - Hoisted keyLockEnabled out of the per-flavor #if defined(COLORLCD)/ #elif LCD_W==128/#else block in datastructs_private.h into the shared prefix (alongside modelQuickSelect/oneLogPerDay), removing the 3x duplication that let the c14/v12 YAML omissions happen in the first place. Verified sizeof(RadioData) is unchanged for all three flavors (COLORLCD/LCD_W==128/else) via chksize.h's static_assert, and regenerated every target's yaml_datastructs via tools/generate-yaml.sh (only field order/padding shifted, no fields added or removed elsewhere). Mirrors the fixes applied to the same feature on main in #7569.
The port of #7383 placed the new key lock label/checkbox at row 30 in gridLayout_2, which was already occupied by the PPM units label/combobox. Move key lock to row 31 and shift the trailing vertical spacer to row 32. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
PR #7383 disabled the General Setup key-lock checkbox on boards whose hw_defs JSON has no key_lock_combo, via BoardJson::hasKeyLockCombo(). 2.12 predates the JSON hw_defs system, so this backport never gained that gating and always showed the checkbox enabled, even on boards where the firmware compiles out the feature entirely for lack of a KEYS_LOCK_KEY1/KEY2 combo: V12, XLite/XLites, PA01, and the whole PL18 family (NV14, EL18, PL18, PL18EV, PL18U, NB4P). Add Board::HasKeyLockCombo, backed by the existing IS_* board-family helpers instead of JSON, and gate the checkbox/label the same way generalsetup.cpp already gates other per-board UI elements. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
pfeerick
force-pushed
the
pfeerick/keys-lock-2.12
branch
from
August 6, 2026 02:23
4f06741 to
36e01af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
2.12release branch, up to and including 961df15.keys_lock.cpptest.mainand adapted to2.12's tree: reused existing bitfield padding for the newkeyLockEnabledflag (no struct size change), regeneratedyaml_datastructs_*.cppviatools/generate-yaml.sh, and re-wired the colorlcd key-shortcuts menu to2.12's pre-refactorChoice/quick_menuwidgets instead ofmain's newerQMPageChoice/qmpagechoice.h(which don't exist on2.12).keyIsSupported()inline helper inradio/src/hal/key_driver.h(present onmain, absent on2.12) since the feature depends on it.Test plan
X9D/taranis)X10/horus)X7/T20V2)Once merged into
2.12, the original3djc/keys-lockbranch (PR #7383) will be rebased ontomainfor the remaining refactor commits.🤖 Generated with Claude Code