summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorSelene ToyKeeper <ToyKeeper@users.noreply.github.com>2022-11-16 14:46:11 -0700
committerGitHub <noreply@github.com>2022-11-16 13:46:11 -0800
commit31fb55ae7b495508c2fd3d56616d11564a0c3f0c (patch)
treec510b697c1a6026edc9d233e9d0b71d4e3dae5f0 /quantum
parent63377c8c572ff44c9ff55896f27bd922a7ef63d4 (diff)
fixed MOUSEKEY_INERTIA on AVR (#19096)
Co-authored-by: Selene ToyKeeper <git@toykeeper.net>
Diffstat (limited to 'quantum')
-rw-r--r--quantum/mousekey.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/quantum/mousekey.c b/quantum/mousekey.c
index b91db80de6..703fb39fa6 100644
--- a/quantum/mousekey.c
+++ b/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)