Skip to content

Commit

Permalink
fixed MOUSEKEY_INERTIA on AVR (qmk#19096)
Browse files Browse the repository at this point in the history
Co-authored-by: Selene ToyKeeper <git@toykeeper.net>
  • Loading branch information
ToyKeeper and ToyKeeper committed Nov 16, 2022
1 parent 63377c8 commit 31fb55a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quantum/mousekey.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static int8_t move_unit(uint8_t axis) {

// x**2 acceleration (quadratic, more precise for short movements)
int16_t percent = (inertia << 8) / mk_time_to_max;
percent = (percent * percent) >> 8;
percent = ((int32_t)percent * percent) >> 8;
if (inertia < 0) percent = -percent;

// unit = sign(inertia) + (percent of max speed)
Expand Down

0 comments on commit 31fb55a

Please sign in to comment.