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

Fixes to allow correct build #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions driver/accel.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ INLINE void updata_params(ktime_t now)
// Acceleration happens here
int accelerate(int *x, int *y, int *wheel)
{
float delta_x, delta_y, delta_whl, ms, speed, accel_sens, product, motivity;
float e = 2.71828f;
float delta_x, delta_y, delta_whl, ms, speed, accel_sens, product, motivity;
const float e = 2.71828f;
static long buffer_x = 0;
static long buffer_y = 0;
static long buffer_whl = 0;
//Static float assignment should happen at compile-time and thus should be safe here. However, avoid non-static assignment of floats outside kernel_fpu_begin()/kernel_fpu_end()
static float carry_x = 0.0f;
static float carry_x = 0.0f;
static float carry_y = 0.0f;
static float carry_whl = 0.0f;
static float last_ms = 1.0f;
static ktime_t last;
ktime_t now;
static float last_ms = 1.0f;
static ktime_t last;
ktime_t now;
int status = 0;

// We can only safely use the FPU in an IRQ event when this returns 1.
Expand Down
22 changes: 5 additions & 17 deletions driver/config.sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,13 @@
#define ACCELERATION 0.26f
#define SENS_CAP 4.0f
#define OFFSET 0.0f
#define POST_SCALE_X 0.4f
#define POST_SCALE_Y 0.4f
#define SPEED_CAP 0.0f

// Prescaler for different DPI values. 1.0f at 400 DPI. To adjust it for <your_DPI>, calculate 400/your_DPI

// Generic @ 400 DPI
#define PRE_SCALE_X 1.0f
#define PRE_SCALE_Y 1.0f

// Steelseries Rival 110 @ 7200 DPI
//#define PRE_SCALE_X 0.0555555f
//define PRE_SCALE_Y 0.0555555f

// Steelseries Rival 600/650 @ 12000 DPI
//#define PRE_SCALE_X 0.0333333f
//#define PRE_SCALE_Y 0.0333333f

// 1 for Linear, 2 for Classic and 3 for Motivity
#define ACCELERATION_MODE 1

// For exponential curves.
#define EXPONENT 2.0f
#define EXPONENT 2.0f

// For sigmoidal curves.
#define MIDPOINT 1.0f
7 changes: 6 additions & 1 deletion driver/usbmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/init.h>
#include <linux/usb/input.h>
#include <linux/hid.h>
#include <linux/version.h>

/* for apple IDs */
/* //Leetmouse Mod BEGIN
Expand Down Expand Up @@ -180,7 +181,11 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
return -ENODEV;

pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,19,0)
maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
#else
maxp = usb_maxpacket(dev, pipe);
#endif

mouse = kzalloc(sizeof(struct usb_mouse), GFP_KERNEL);
input_dev = input_allocate_device();
Expand Down