Skip to content

fix(radio): trims are actually controls rather than keys for backlight#7515

Merged
pfeerick merged 1 commit into
mainfrom
3djc/backlight-notrim-wakeup
Jul 22, 2026
Merged

fix(radio): trims are actually controls rather than keys for backlight#7515
pfeerick merged 1 commit into
mainfrom
3djc/backlight-notrim-wakeup

Conversation

@3djc

@3djc 3djc commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes:

Trims are now considered as controls rather than keys, which I think they should be

Fixes #7512

Summary by CodeRabbit

  • Bug Fixes
    • Improved inactivity detection by more accurately distinguishing between key/button activity and trim activity.
    • Trim activity is now treated as control activity, helping avoid entering inactivity sooner than expected.
    • When navigation controls and trims are used together, activity tracking is more reliable for keeping the device awake.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 94c12a53-1eff-4af3-bcef-d9acf558887e

📥 Commits

Reviewing files that changed from the base of the PR and between bde76e6 and c01a7df.

📒 Files selected for processing (3)
  • radio/src/edgetx.cpp
  • radio/src/keys.cpp
  • radio/src/keys.h
🚧 Files skipped from review as they are similar to previous changes (3)
  • radio/src/edgetx.cpp
  • radio/src/keys.h
  • radio/src/keys.cpp

📝 Walkthrough

Walkthrough

keysPollingCycle() now returns a uint8_t bitmask distinguishing key and trim activity. per10ms() routes key activity to Keys and trim activity to MainControls when resetting inactivity timers.

Changes

Key/Trim Activity Bitmask

Layer / File(s) Summary
Activity flag enum and function signature
radio/src/keys.h, radio/src/keys.cpp
Defines separate key and trim activity flags, changes keysPollingCycle() to return uint8_t, and constructs the bitmask from key and trim input.
Inactivity timer routing by activity source
radio/src/edgetx.cpp
Checks activity bits independently, mapping key activity to ActivitySource::Keys and trim activity to ActivitySource::MainControls.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: UX-UI

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main backlight behavior change and is directly related to the trim/key handling update.
Description check ✅ Passed The description includes a brief summary and the linked issue reference, which is sufficient for the repository template.
Linked Issues check ✅ Passed The code changes make trim activity count as controls instead of keys, matching the issue's backlight-on-Keys requirement.
Out of Scope Changes check ✅ Passed The API/signature changes appear necessary to support the backlight fix and do not introduce unrelated behavior.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 3djc/backlight-notrim-wakeup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@3djc 3djc added the rn: warning Warning needed in release notes label Jul 2, 2026
@3djc 3djc added this to the 3.0 milestone Jul 2, 2026
@elecpower

Copy link
Copy Markdown
Collaborator

Does this also require a Companion change to mirror?

@3djc

3djc commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

I don't think so @elecpower. There is no change in settings or yaml. Simply, backlight will no longer react to trims if you have them set to keys, but will now trigger reaction if set to controls. The changes should be present in various simu too

@pfeerick pfeerick added bug 🪲 Something isn't working firmware General radio firmware issue, not colorlcd or B&W specific labels Jul 3, 2026
@pfeerick
pfeerick force-pushed the 3djc/backlight-notrim-wakeup branch from bde76e6 to c01a7df Compare July 14, 2026 00:08
@pfeerick

Copy link
Copy Markdown
Member

Makes perfect sense! :)

@pfeerick
pfeerick merged commit b706c40 into main Jul 22, 2026
40 checks passed
@pfeerick
pfeerick deleted the 3djc/backlight-notrim-wakeup branch July 22, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working firmware General radio firmware issue, not colorlcd or B&W specific rn: warning Warning needed in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Radiomaster MT12 trim buttons should not activate displaylight

3 participants