diff options
| author | MmAaXx500 <viktor.balogh45@gmail.com> | 2024-06-16 11:05:50 +0200 |
|---|---|---|
| committer | MmAaXx500 <viktor.balogh45@gmail.com> | 2024-06-17 13:26:30 +0200 |
| commit | c2bc4fe4b80a2a5c78841fbeb5a9ff2b51f59449 (patch) | |
| tree | 25123feb200d4f5d38186aa158efe09074140d3c /src/tmt300rs | |
| parent | 3af1e6106366d3d8acc6ba8bea8f047489c1d4d0 (diff) | |
| download | hid-tmff2-c2bc4fe4b80a2a5c78841fbeb5a9ff2b51f59449.tar.gz hid-tmff2-c2bc4fe4b80a2a5c78841fbeb5a9ff2b51f59449.zip | |
correct constant force level
Diffstat (limited to 'src/tmt300rs')
| -rw-r--r-- | src/tmt300rs/hid-tmt300rs.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |
