From ca7f949ee84a7f15990c9e09f2de9ea54b8f997a Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 24 Feb 2024 12:13:47 -0600 Subject: core: hid: Reintroduce vibration filter --- src/hid_core/hid_types.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/hid_core/hid_types.h') diff --git a/src/hid_core/hid_types.h b/src/hid_core/hid_types.h index 1b2fc6295..38888fdd1 100644 --- a/src/hid_core/hid_types.h +++ b/src/hid_core/hid_types.h @@ -638,7 +638,11 @@ struct VibrationValue { if (low_amplitude != b.low_amplitude || high_amplitude != b.high_amplitude) { return false; } - if (low_frequency != b.low_amplitude || high_frequency != b.high_frequency) { + // Changes in frequency without amplitude don't have any effect + if (low_amplitude == 0 && high_amplitude == 0) { + return true; + } + if (low_frequency != b.low_frequency || high_frequency != b.high_frequency) { return false; } return true; -- cgit v1.2.3