Skip to content

fix(pl18u): Encoder emulation acceleration not implemented properly#7403

Open
richardclli wants to merge 1 commit into
mainfrom
richardclli/fix-pl18u-encoder-emulation
Open

fix(pl18u): Encoder emulation acceleration not implemented properly#7403
richardclli wants to merge 1 commit into
mainfrom
richardclli/fix-pl18u-encoder-emulation

Conversation

@richardclli
Copy link
Copy Markdown
Member

@richardclli richardclli commented May 28, 2026

PL18U uses encoder emulation by key presses, acceleration is not implemented properly.

opencode + deepseek pro find the bug by just code reading ^.^

Summary by CodeRabbit

  • Bug Fixes
    • Improved rotary encoder timing and responsiveness during key processing.

Review Change Stack

@richardclli richardclli added this to the 2.11.7 milestone May 28, 2026
@richardclli richardclli self-assigned this May 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

pl18u_key_driver.cpp integrates timer-based delta time tracking for rotary encoder state detection. The rotary encoder value is marked volatile to ensure safe concurrent access, the timers driver header is included, and delta time is initialized from get_tmr10ms() when the rotation state reaches a stable count (outside BOOT builds).

Changes

Rotary encoder timing and state safety

Layer / File(s) Summary
Rotary encoder timer integration and volatile state
radio/src/targets/pl18/pl18u_key_driver.cpp
Includes timers_driver.h, marks rotencValue volatile for safe concurrent access, and initializes rotencDt from get_tmr10ms() when rotation state stabilizes at stateCount == 3 (conditional on non-BOOT build).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The PR description is minimal and lacks required structure. It's missing issue reference, detailed summary of changes, and doesn't follow the template. Add issue reference (Fixes #), provide detailed summary of changes, explain why the fix is needed, and how it addresses the bug mentioned.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing encoder emulation acceleration in the PL18U device driver.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 richardclli/fix-pl18u-encoder-emulation

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 and usage tips.

@richardclli
Copy link
Copy Markdown
Member Author

@pfeerick This one is done, can merge

@pfeerick pfeerick added the backport/2.11 To be backported to a 2.11 release also. label Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/2.11 To be backported to a 2.11 release also.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants