per device config - #110
Conversation
|
I'm picking this up again after I left it for a while, so I'm kinda rebuilding the context of what I'm working on (basically I forgot what I was doing lol) |
dd43f5e to
c623eee
Compare
|
config paths now look something like in my case I have tested configuring multiple mice with different configurations and it's working :) |
|
I'm not really familiar with all the acceleration modes, so I'm not sure how to test them, @AndyFilter if you have any suggestion it would be helpful, or maybe some collection of input values to test manually |
Awesome! That's great to hear, the progress is faster than I expected. I'll test the code myself too soon. Quickly looking at the CI that failed - I think it's just an issue with some includes, so once that's fixed you'll be able to build and run the unit tests. But I doubt anything has changed, as you didn't change any acceleration function implementation. I'll take a look at the tests right now, maybe it's an easy fix. (Also, when running the tests, you don't need to copy and files, or use any python scripts anymore, I just forgot to remove that from the instructions.)
I'm not sure what exactly are you asking about, simple unit tests for all the acceleration modes/functions, if so, then the Tests suite is your friend: https://github.com/AndyFilter/YeetMouse/tree/master/tests. If you want to check if a given mode applied on your system ACTUALLY applies the correct acceleration, then you need a bit more sophisticated setup; and a external device that can emulate a mouse. You don't have to test for this, I'll take care of it, in some spare time, as I already have everything set up, just need to plug the microcomputer to my PC. |
AndyFilter
left a comment
There was a problem hiding this comment.
I didn't have time to look through the driver code yet. But I left some general comments. About the headers - I will push the commit fixing this later today or tomorrow, as I had to go and didn't have time to finish it. Also, I moved the ModesConstants struct to accel.h, as it's not really a shared definition, because from what I can see only the driver uses it. This also solved most of the compilation issues for the GUI and the Testing Suite. I already managed to get the GUI to compile and work locally, next I'll try to work on the Testing Suite, but that should be a similar story. About the headers in general, it's a slippery topic, as one compiler will accept one thing while the other will not, but I'd try to stick to what was already in the code, as no one seemed to complain about it for some time - meaning it might be working just fine.
| // Include numeric types | ||
| #include <linux/types.h> | ||
|
|
||
| #include <linux/kernel.h> |
There was a problem hiding this comment.
This header is already included in Fixed64.h, just in the other order. I swapped the order and it seems to work.
Edit: There is quite a bit of comments like these regarding the includes, I have fixed these issues in my local code, so I won't leave comments on the rest.
There was a problem hiding this comment.
it didn't work for me for some reason, I will wait for your fixes to try them out 🫡
PS: might be an LSP thing
| FP_LONG accel_linear(const struct ModesConstants *constants, FP_LONG acceleration, bool use_smoothing, FP_LONG speed); | ||
| FP_LONG accel_power(const struct ModesConstants *constants, FP_LONG midpoint, FP_LONG acceleration, FP_LONG exponent, bool use_smoothing, FP_LONG speed); | ||
| FP_LONG accel_classic(const struct ModesConstants *constants, FP_LONG acceleration, bool use_smoothing, FP_LONG speed); | ||
| FP_LONG accel_motivity(const struct ModesConstants *constants, FP_LONG midpoint, FP_LONG speed); | ||
| FP_LONG accel_synchronous(const struct ModesConstants *constants, FP_LONG acceleration, bool use_smoothing, FP_LONG speed); | ||
| FP_LONG accel_natural(const struct ModesConstants *constants, FP_LONG midpoint, bool use_smoothing, FP_LONG speed); | ||
| FP_LONG accel_jump(const struct ModesConstants *constants, FP_LONG midpoint, bool use_smoothing, FP_LONG speed); | ||
| FP_LONG accel_lut(unsigned long lut_pairs, const FP_LONG lut_data_x[MAX_LUT_ARRAY_SIZE], const FP_LONG lut_data_y[MAX_LUT_ARRAY_SIZE], FP_LONG speed); |
There was a problem hiding this comment.
Could we instead of passing all the parameters that a given function uses pass the struct accel_params *params? This would greatly reduce the API's complexity for the driver as well as the Testing Suite.
There was a problem hiding this comment.
I was thinking that would make it clearer, but I can change it no problem
|
Hey, I pushed the commit I was talking about earlier that fixes the GUI building. But I didn't entirely fix the Test Suite as it would require fixing all the - now changed - acceleration modes functions (like btw. let me know if the driver compiles now, after I removed some includes. I tested it and it did compile and work, but I couldn't find the |
got it
ok I will try compiling it soon, this week and maybe the next I will be kinda busy (won't have access to the machine I'm developing with)
hm, that's weird, could you check |
|
I haven't fixed the tests yet, but now the GUI works! (I used some AI for the GUI since I don't know C++ much, hope you're ok with that, but I took a general look at the generated code and made sure it worked) I saw there was an unused I have included the checkbox from your comment here but I can remove it (disabling acceleration is currently not implemented) |
a984371 to
344b3d7
Compare
|
Hey, I took look at the code, and it does look good now. I managed to quickly patch up the tests, and they all pass.
Completely fine with me to speed up work with AI as long as you know the idea / concept behind the code, simply because I'm gonna be asking in the comments for it, haha. Let's focus on the concerns I have about this change. I have a couple of points , but most of them revolve around the fact that I want this to be optional and opt-in rather than opt-out. I described it in this comment: #100 (reply in thread). Now to get to the details. I've managed to install it, and the general functionality seems to work, although when plugging a second mouse I was greeted by a null pointer dereference in the kernel space: This also bricked the whole But like I said earlier, most of these just go back to the comment I referenced earlier. I want this to be an add-on, rather than a replacement for the current config handling, so that people who are currently using the program won't have to deal with a new set of possible bugs. I'll push the test changes, because it's a simple one file change, but I'll hold with the |
related to #100
this adds per device config
current status:
it kinda works, but I'm currently trying to make the sysfs config path more user-friendly, but I'm still figuring out how sysfs works
TODOs: