Conversation
Move config to the top of code Add WAIT_TIME to send less keep_alive signals
andreldm
left a comment
There was a problem hiding this comment.
Hi @ChaosInfinited, thanks a lot for the PR, I added a few comments, I just cannot test because I threw away my mouse a couple of months ago 😓
After merging this I think I'm going to archive this repository, it makes no sense maintaining it if I can't test contributions.
| I_RED, M_RED, I_GREEN, M_GREEN, I_BLUE, M_BLUE); | ||
|
|
||
| transfer(device, 6, device->command_prefix, | ||
| 0x01, 0x20, 0x00, /* Do not change */ |
There was a problem hiding this comment.
The "Do not change" comment can be removed now, also DPI can be moved to this line.
| ungrab_device(device); | ||
| } | ||
|
|
||
| int handle_events(int r) |
There was a problem hiding this comment.
This r parameter seems unnecessary, its value is never read.
|
|
||
| for (int i = 0; RUNNING; ++i) { | ||
| /* Send keep_alive signal every WAIT_TIME s, without blocking whole function. */ | ||
| if(i >= WAIT_TIME / 2) { |
There was a problem hiding this comment.
Why not just set WAIT_TIME as 25 or 30 seconds?
There was a problem hiding this comment.
I believe that due to losing packets or some race condition, I tried using 30 but it just would reset after a minute, instead of persisting current settings
25 was the longest, stable interval I found
|
Hi, thanks for your reply! Sorry for late reply. Ngl I had to get rid off this daemon, it works, but probing the mouse disables autosuspend function, and its battery doesn't like that to say the least.. |
Hiho o/ Thanks for your daemon! I was finally being able to fix that disco my mouse was doing..
Added small changes, so far seems to be working (and spams dmesg much less)
Move config to the top of code
Add WAIT_TIME to send less keep_alive signals (50s interval)