Skip to content

Commit

Permalink
always update effect duration
Browse files Browse the repository at this point in the history
+ According to discussion in #43 this is more along the lines of what
  other wheels do.
  • Loading branch information
Kimplul committed Sep 2, 2022
1 parent 97433a1 commit 0e47624
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions hid-tmt300rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0e47624

Please sign in to comment.