Forráskód Böngészése

fixed MOUSEKEY_INERTIA on AVR (#19096)

Co-authored-by: Selene ToyKeeper <git@toykeeper.net>
Selene ToyKeeper 2 éve
szülő
commit
31fb55ae7b
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      quantum/mousekey.c

+ 1 - 1
quantum/mousekey.c

@@ -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)