From c2bc4fe4b80a2a5c78841fbeb5a9ff2b51f59449 Mon Sep 17 00:00:00 2001 From: MmAaXx500 Date: Sun, 16 Jun 2024 11:05:50 +0200 Subject: correct constant force level --- src/tmt300rs/hid-tmt300rs.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/tmt300rs/hid-tmt300rs.c b/src/tmt300rs/hid-tmt300rs.c index 0191620..a1efd7d 100644 --- a/src/tmt300rs/hid-tmt300rs.c +++ b/src/tmt300rs/hid-tmt300rs.c @@ -630,6 +630,8 @@ static int t300rs_update_constant(struct t300rs_device_entry *t300rs, int16_t level; level = (constant.level * fixp_sin16(effect.direction * 360 / 0x10000)) / 0x7fff; + /* the Windows driver uses the range [-16385;16381] */ + level = level / 2; if ((constant.level != constant_old.level) || (effect.direction != old.direction)) { @@ -948,6 +950,8 @@ static int t300rs_upload_constant(struct t300rs_device_entry *t300rs, int ret; level = (constant.level * fixp_sin16(effect.direction * 360 / 0x10000)) / 0x7fff; + /* the Windows driver uses the range [-16385;16381] */ + level = level / 2; duration = effect.replay.length - 1; offset = effect.replay.delay; -- cgit v1.3