From 0e47624ebbed48e922fe27170364aebf79217e7b Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 2 Sep 2022 19:03:22 +0300 Subject: always update effect duration + According to discussion in #43 this is more along the lines of what other wheels do. --- hid-tmt300rs.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/hid-tmt300rs.c b/hid-tmt300rs.c index 5120d4b..31dbfd4 100644 --- a/hid-tmt300rs.c +++ b/hid-tmt300rs.c @@ -536,17 +536,14 @@ static int t300rs_update_duration(struct t300rs_device_entry *t300rs, duration = effect.replay.length - 1; - if (effect.replay.length != old.replay.length) { + t300rs_fill_header(&packet_mod_duration->header, effect.id, 0x49); + packet_mod_duration->marker = cpu_to_le16(0x4100); + packet_mod_duration->duration = cpu_to_le16(duration); - t300rs_fill_header(&packet_mod_duration->header, effect.id, 0x49); - packet_mod_duration->marker = cpu_to_le16(0x4100); - packet_mod_duration->duration = cpu_to_le16(duration); - - ret = t300rs_send_int(t300rs); - if (ret) { - hid_err(t300rs->hdev, "failed modifying duration\n"); - goto error; - } + ret = t300rs_send_int(t300rs); + if (ret) { + hid_err(t300rs->hdev, "failed modifying duration\n"); + goto error; } error: -- cgit v1.3