From 958fa788067e18c2228d016fcd826000bb8f0320 Mon Sep 17 00:00:00 2001 From: Jakob Linke <36006+schuay@users.noreply.github.com> Date: Wed, 10 Dec 2025 09:49:34 +0100 Subject: [PATCH] fix(behaviors): correctly handle sensor rotation remainder (#3084) The original condition was always true, this commit fixes the condition to correctly handle the remainder for sensor rotation behaviors by using abs(). Co-authored-by: schuay --- app/src/behaviors/behavior_sensor_rotate_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/behaviors/behavior_sensor_rotate_common.c b/app/src/behaviors/behavior_sensor_rotate_common.c index 278f1cb2b..724612865 100644 --- a/app/src/behaviors/behavior_sensor_rotate_common.c +++ b/app/src/behaviors/behavior_sensor_rotate_common.c @@ -34,7 +34,7 @@ int zmk_behavior_sensor_rotate_common_accept_data( remainder.val1 += value.val1; remainder.val2 += value.val2; - if (remainder.val2 >= 1000000 || remainder.val2 <= 1000000) { + if (abs(remainder.val2) >= 1000000) { remainder.val1 += remainder.val2 / 1000000; remainder.val2 %= 1000000; }