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
2 people authored and ramonimbao committed Nov 28, 2022
1 parent 20474e3 commit d4c5271
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 d4c5271

Please sign in to comment.