-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mouse report comparison failing on shared EP (fixes KB preventing sleep) #18060
Conversation
@drashna Do you mind checking this out? |
As far as I'm aware, this shouldn't be needed. So the report ID that is sent shouldn't matter, as it's immediately set. Also, I've been using the mouse shared EP for a while and have no issues with sleeping. |
The problem appears on split keyboard, when the pointing device is on slave. |
The thing is I am using a split keyboard and master is left, device is right. However, are you using AVR or ARM here? And it may be better to just zero out the reports on init here? |
I'm on AVR. According to the comment the buttons must remain. The problem here is that qmk_firmware/quantum/pointing_device.c Line 242 in e44b624
|
9170218
to
7d82420
Compare
Changed to zeroing the whole report, preserving buttons. |
Aah, okay. Might be worth: local_mouse_report = POINTING_DEVICE_THIS_SIDE ? pointing_device_driver.get_report(local_mouse_report) : shared_mouse_report;
#ifdef MOUSE_SHARED_EP
local_mouse_report.report_id = REPORT_ID_MOUSE;
#endif |
I would need to add it to all paths, so a little bit lower. However it seems a bit more natural to me to zero it in the place that was already setting other members to 0. (Probably it was also broken on extended reports since it did not zero extended members) |
local_mouse_report.v = 0; | ||
local_mouse_report.h = 0; | ||
uint8_t buttons = local_mouse_report.buttons; | ||
memset(&local_mouse_report, 0, sizeof(local_mouse_report)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should shared_mouse_report
also be zeroed out here? Both sides update pointing device at generally the same rate due to the throttle, but there is no explicit synchronization for this AFAICT so shared_mouse_report
potentially contains stale information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
7d82420
to
46d1c0f
Compare
Thanks for this! |
I think we should merge it as is, since preventing sleep is a major bug. Then we can discuss any further refactoring. Maybe create an issue with your ideas and we can pick it up from there. |
Co-authored-by: Dasky <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
Yeah, I agree. |
Co-authored-by: Dasky <[email protected]>
Reset report ID that gets changed when sending mouse report to host.
Description
Properly reset the in-memory mouse report, so that it's not sent all the time. Current behavior prevents power saving on host.
Types of Changes
Checklist