From: Michal MalĂ˝ Date: Mon, 12 Oct 2015 14:57:23 +0000 (+0200) Subject: HIGHLY EXPERIMENTAL: Update effect timing only when it makes sense X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=KLGD_FF_plugin.git HIGHLY EXPERIMENTAL: Update effect timing only when it makes sense --- diff --git a/plugin/klgd_ff_plugin.c b/plugin/klgd_ff_plugin.c index dcccdce..12d5c9d 100644 --- a/plugin/klgd_ff_plugin.c +++ b/plugin/klgd_ff_plugin.c @@ -804,7 +804,8 @@ static void ffpl_upload_handler(struct klgd_plugin_private *priv, const struct f eff->trigger = FFPL_TRIG_NOW; } else { eff->replace = false; - ffpl_update_trip_times(eff, now); + if (ffpl_handle_timing(priv, ueff)) + ffpl_update_trip_times(eff, now); /* The effect is yet to be started, do not try to update it */ if (eff->change == FFPL_TO_START) diff --git a/testmod/klgdff.c b/testmod/klgdff.c index edd43aa..6f36f06 100644 --- a/testmod/klgdff.c +++ b/testmod/klgdff.c @@ -381,12 +381,12 @@ static int __init klgdff_init(void) input_set_capability(dev, EV_FF, FF_CONSTANT); input_set_capability(dev, EV_FF, FF_RUMBLE); - /*input_set_capability(dev, EV_FF, FF_PERIODIC); + input_set_capability(dev, EV_FF, FF_PERIODIC); input_set_capability(dev, EV_FF, FF_SINE); input_set_capability(dev, EV_FF, FF_SQUARE); input_set_capability(dev, EV_FF, FF_SAW_UP); input_set_capability(dev, EV_FF, FF_SAW_DOWN); - input_set_capability(dev, EV_FF, FF_TRIANGLE);*/ + input_set_capability(dev, EV_FF, FF_TRIANGLE); input_set_capability(dev, EV_FF, FF_RAMP); input_set_capability(dev, EV_FF, FF_SPRING); @@ -400,9 +400,9 @@ static int __init klgdff_init(void) ret = ffpl_init_plugin(&ff_plugin, dev, EFFECT_COUNT, FFPL_HAS_EMP_TO_SRT | FFPL_REPLACE_STARTED | - //FFPL_MEMLESS_CONSTANT | - //FFPL_MEMLESS_PERIODIC | - //FFPL_MEMLESS_RUMBLE | + FFPL_MEMLESS_CONSTANT | + FFPL_MEMLESS_PERIODIC | + FFPL_MEMLESS_RUMBLE | FFPL_TIMING_CONDITION, klgdff_control, &test_user); if (ret) {