-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update harpoond.c #8
base: master
Are you sure you want to change the base?
Conversation
Move config to the top of code Add WAIT_TIME to send less keep_alive signals
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.
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.
0x00, /* Main LED's green */ | ||
0x00, /* Indicator LED's blue */ | ||
0x00); /* Main LED's blue */ | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Do not change" comment can be removed now, also DPI can be moved to this line.
@@ -211,6 +219,16 @@ static void keep_alive(Device *device) | |||
ungrab_device(device); | |||
} | |||
|
|||
int handle_events(int r) |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just set WAIT_TIME as 25 or 30 seconds?
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.
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)