Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ChaosInfinited
Copy link

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)

Move config to the top of code
Add WAIT_TIME to send less keep_alive signals
Copy link
Owner

@andreldm andreldm left a 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 */
Copy link
Owner

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)
Copy link
Owner

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) {
Copy link
Owner

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?

Copy link
Author

@ChaosInfinited ChaosInfinited May 19, 2022

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

@ChaosInfinited
Copy link
Author

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants