From fff91b28e1260d634487e9fdce4bac316b993c0e Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 21 Sep 2020 20:16:04 +0300 Subject: F1 2018 fix --- hid-tmt300rs.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hid-tmt300rs.c b/hid-tmt300rs.c index aa1db0a..7fbe829 100644 --- a/hid-tmt300rs.c +++ b/hid-tmt300rs.c @@ -924,6 +924,10 @@ static int t300rs_timer_helper(struct t300rs_device_entry *t300rs){ /* lazy bum fix? */ __clear_bit(FF_EFFECT_QUEUE_UPDATE, &state->flags); + if(state->count){ + state->count--; + } + if(state->count){ __set_bit(FF_EFFECT_QUEUE_START, &state->flags); } @@ -950,9 +954,6 @@ static int t300rs_timer_helper(struct t300rs_device_entry *t300rs){ return ret; } - if(state->count){ - state->count--; - } } if(test_bit(FF_EFFECT_QUEUE_STOP, &state->flags)){ @@ -1042,11 +1043,16 @@ static int t300rs_play(struct input_dev *dev, int effect_id, int value){ t300rs->effects_used++; }*/ + + state->count = value; state->start_time = JIFFIES2MS(jiffies); __set_bit(FF_EFFECT_QUEUE_START, &state->flags); - } else if(test_bit(FF_EFFECT_PLAYING, &state->flags)){ + if(test_bit(FF_EFFECT_QUEUE_STOP, &state->flags)) + __clear_bit(FF_EFFECT_QUEUE_STOP, &state->flags); + + } else { __set_bit(FF_EFFECT_QUEUE_STOP, &state->flags); } -- cgit v1.3